Conversation

It serves a useful purpose nevertheless: pointing out that how we build our libraries is brittle (not just in Haskell). Hierarchies of any kind don't tend to survive having a new member added 'in the middle'. This is dumb engineering.
2
11
Some of my work on generating library code has been linked to that problem. My solutions are not good ones, BUT at least I show that solutions do exist. As a faint hope that others would take up the cause and find better solutions. I'm still waiting.
1
4
I'd love to see a future where we can make use of these solutions! I'd love to live in a world where we can evolve libraries in a less brittle way than seems to be possible with type classes.
1
1
Well, clarifying: type classes as they exist in languages like Haskell and Rust. Not sure how module systems compare for these kinds of changes? I'd imagine there are still issues?
1
2
type classes (and module types and traits) are all variants of interfaces along with extra rules for conformance and/or resolution. The first step is to revisit interfaces and how to build & compose them. In fact, interfaces should be first class, but they aren't (yet).
2
3
When people talk about first class modules, they usually mean the *implementation* part (i.e. 'module struct' in ML) rather than interfaces (i.e. 'module sig'). That's the operational bias kicking in again, favouring the stuff that runs over the stuff that declares intent.
1
4
Exactly. I want well-'typed' programs that manipulate modules types and/or dependent record types. The same way we can work magic with first class functions.
1
3
Replying to and
Semantically, it's "trivial". AxB is isomorphic to (x : Fin 2) -> F x, where F : Fin 2 -> Type, F 0 = A, F 1 = B. Generalize this to using some index set I instead of the (ordered!) Fin k. The problem is coming up with a pleasant syntax.
3