You're on to something very fundamental about type classes ;-)
Conversation
What is it?
(Not sure if I should be thinking in the direction of "they're actually not special" or "they're more special than I think!")
2
1
Type classes are just a fancy, built-in way of passing records of functions around implicitly. Alas, they live in a separate language space.
1
2
I'm guessing you are already aware of this though 😉
1
2
1
3
I mean nothing too profound -- type classes tie "laws" to type-directed implicit arguments in a way that mystifies the two distinct concepts
2
4
in ML signatures specify an interface -- over both types and values -- and you can associate laws with the signature. much neater imo!
2
1
11
Tbh part of me regrets not having a sufficiently-strong set of counterarguments ready at the time, against the push for traits in Rust.
2
5
We started with a (very poorly implemented) first-class module system, bolted on a very dynamic object system, then deleted both for traits.
2
1
1
My memory of those years is carrying around Rossberg & Dreyer, Owens & Flatt papers, trying to understand enough to make it work, failing :(
2
2
Yeah, always frustrating to be seemingly grovelling in the shadows of giants, trying to get your head around ideas that have gone before…
fwiw bob harper's book (practical foundations for PL) has a pretty accessible (assuming basic type theory) few chapters on module calculi
1
1
5
It's sitting next to me on my bookshelf here. If only I had it on my shelf 10 years ago.
3



