ML-style module systems are lots of fun haha
Conversation
it’s super useful. i also like haskell’s approach where libraries can specify an interface and the application author just specifies a module that satisfies that interface. i’ve never used it but i think it would get me 95% of the way there
2
2
Are you referring to Backpack?
1
1
yeah
1
1
Ahh yeah I've not yet seen it used much in the wild, but it seemed neat? Apparently it was confined to cabal so folks using stack couldn't take advantage?
1
1
Trouble with retrofitting this stuff onto Haskell or Rust is that typeclasses and traits already take up so much room in the language already :(
1
1
2
yeah :( i love them but i’m starting to think traits were a mistake. unison opens up a possible approach actually that I think solves coherence. basically on disk typeclass records are passed explicitly, and when rendering the code you can pick an instance to pass implicitly
2
1
Replying to
Yeah ditto with traits. We should have listened to Graydon!
Well, to be more nuanced, I can see why traits were implemented at the time, but they kind of box you in design-wise, and make pretty fundamental assumptions that are hard to undo. I feel a similar way with async/await.
Effects-and-handlers seem like a much nicer approach to asynchronous scheduling imo. Not sure about using them for trait-style stuff though? It's an interesting connection for sure though.

