3 ms·
Notably absent (at least in the docs) is a Hash/Map datatype, a struct type may be beyond the goals of the language. I do see how it straddles Python and TypeSc
by karmakaze 5y ago
Notably absent (at least in the docs) is a Hash/Map datatype, a struct type may be beyond the goals of the language. I do see how it straddles Python and TypeScript in character. One thing I miss from TypeScript is the Union/Sum type which is far underutilized in languages.
- maweki 5y agoProper union types are really hard if you want to do anything more than check. Once you're into inference territory, this gets really hard. Look at Haskell's faux union Either. It should be true that Either a a = a but of course, it isn't and you always have to destructure this. In inference it's easier to just infer one most general type instead of a (possibly infinite) number of sets of types. Basicaly wherever types are ambiguous, you'd need to try all alternatives and possibly compile all of them. Faux unions are also underused but we do find them from time to time.