4 ms·
I see, so similar to the other languages I mentioned in my post, it looks like Haskell doesn't let you colocate the types with the leaves of the binding form?
by sestep 1y ago
I see, so similar to the other languages I mentioned in my post, it looks like Haskell doesn't let you colocate the types with the leaves of the binding form?
- instig007 1y ago> doesn't let you colocate the types with the leaves of the binding form Can you elaborate on the effective difference between colocations in your example and this: transport Kwargs {person = Person{name = who, ..}, options = Opts{..}, ..} The `Kwargs{..}` alone does imply a non-ambiguous type in the function signature (without explicit but optional annotations), and it binds locally scoped names too. Why doesn't it colocate in the same sense?
- sestep 1y agoIt's similar to the Rust example from my post: there are no anonymous records, so in order to be able to construct something with named fields, you need to first define those record types outside. In contrast, my proposed syntax depends on already having anonymous record types like OCaml and TypeScript do, but avoids the extra boilerplate required by separating types from binding forms as shown in my TypeScript example.
- instig007 1y agoBut structural typing that allows you defining anonymous record types is orthogonal to colocation of types and bindings. You're effectively saying that you're proposing a type system that supports structural types, syntax and colocation don't have much to do with it.
- sestep 1y agoCould you clarify what you mean? TypeScript already has structural types, but I already examined it in my post; if that were the only thing I was saying then my post would have just used TypeScript at the top.