By the way is there any reason you couldn't attach laws to just like, a record of functions? Why are classes special?
-
-
Replying to @glaebhoerl @thumphriees
You're on to something very fundamental about type classes ;-)
1 reply 0 retweets 1 like -
Replying to @neurocy @thumphriees
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 replies 0 retweets 1 like -
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 reply 0 retweets 2 likes -
Replying to @brendanzab @glaebhoerl and
I'm guessing you are already aware of this though
1 reply 0 retweets 2 likes -
Yeah; I'm kind of hoping
@neurocy has something more profound or subtle in mind :)1 reply 0 retweets 3 likes -
I mean nothing too profound -- type classes tie "laws" to type-directed implicit arguments in a way that mystifies the two distinct concepts
2 replies 0 retweets 4 likes -
Replying to @neurocy @glaebhoerl and
in ML signatures specify an interface -- over both types and values -- and you can associate laws with the signature. much neater imo!
2 replies 1 retweet 11 likes -
Replying to @neurocy @glaebhoerl and
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 replies 0 retweets 5 likes -
Replying to @graydon_pub @neurocy and
Tbh I do prefer the 'programming with interface constraints' feeling I get using TCs. I would prefer traditional TCs over ML modules…
3 replies 0 retweets 1 like
My feeling is that (pardon the cliché) typeclasses are the worst of all module systems, except for all the others.
-
-
Replying to @pcwalton @brendanzab and
Yeah I know. And in the grand scheme of things any response to Rust’s incredible success is a bit churlish of me. I just daydream sometimes.
2 replies 0 retweets 4 likes -
Replying to @graydon_pub @brendanzab and
No need to apologize…typeclasses have lots of problems and it’s best to be up front about them
0 replies 0 retweets 2 likes
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.