Earlier quoted context omitted.
> It's not impossible to type check heterogeneous maps at compile time, but most static type systems don't support this I guess you mean dependent types[1], but if you don't, I'd appreciate an elaboration. If you do mean DTs, how might it look for a hetero collection? [1] If anybody has any good intros to dependent typing in C#, that'd be much appreciated. A web search throws up some pretty intimidating stuff.
while you probably can do this with dependent types, i'd imagine GP means something along the lines of typescript's structural typing, i.e. const post = { id: 123, content: "...", published: true, } // TS infers the type of `post` to be an unnamed "map-ish" type: // { id: number, content: string, published: boolean } JS objects are map-like, and this one is "heterogenous" in that the values are of different types (un…
I'm actually talking about C# because I'm working in it and I'd like to make some compile-time guarantees if possible. Or at least know how to assure a method that they are getting a list with at least 2 values in it, for example. It may not be worth the effort but it would be nice to know how.
I've got books on DT, idris, and another DT lang, trouble is there's no call for any of this stuff in industry so they get repeatedly pushed to the bottom of the priority stack. Sickening, innit.