Seems like a nice feature. Am I right in thinking this is all at the syntax level?
I do wonder whether it’s worth thinking about the syntax type destructuring too (even if it’s not being implemented now) - since there may be a different syntax style that’ll work nicely for both. Just so there’s no backwards compatible issues later down the line.
I like this idea, although I don’t like mixing let and type in the same expression, given that they’re different “layers” of the language. Perhaps they could be supported as separate expressions though?
let { a, b } = M
type { c, d<'e, 'f> } = M
module { G, H } = M
Come to think of it, “importing” modules this way would be very useful.
Am I right in thinking this is all at the syntax level?
currently yes.
I do wonder whether it’s worth thinking about the syntax type destructuring too (even if it’s not being implemented now) - since there may be a different syntax style that’ll work nicely for both.
I agree, @johnj’s proposal makes more sense to me
The pattern match over module for values is done on master.
We will evaluate how to apply pattern match over module for types, thanks for the feedback!
What is the syntax transform that is happening here? Would this just transform to a bunch of aliases or does it use FCM’s (given the module is packed using module(x)).
so that not re-exporting is low-friction? I assume having that be a low-friction thing to do would be desired in ML-ish languages as much as it is with others, so that names aren’t exported just because it’s the shortest way to write it?
I like the idea, one of the first things my coworkers who write Haskell asked me when I started showing them Reason/ReScript was whether it can do import hiding. The new syntax is close enough, for functions anyway.