TIL, #Haskell classes are _collection of_ types. They themselves are not types. It's a bit different from OO world, where classes _are_ types.
In that sense, Functor is a collection of classes, it allows me to map from type `a` to type `b` in a particular class. 🤔
#TypeClasses
Conversation
This Tweet was deleted by the Tweet author. Learn more
> writing a post
Good news to me. 🤓
> type classes as a function from type to set of operations.
Oh okay. It means, kinda, an `Eq` is a function from type `a` to {(==), (/=)}.
{..} as in set notation. 🤔
1
1
Here's how I'm going to be sorta do it in Pikelet - a type class is a function type. In order to implement instances you make a function: github.com/brendanzab/rus - it's really easy to confuse where the function type and the lambda is in Haskell's notation.
Note that I haven't got around to implementing the instance solving thingy and I'm expecting that to be 'fun'. Wish me luck! 😬
1
2
> a type class is a function type
Yeah, that's another cool representation. IMO, when _types_ are first-class, some things make more sense, as in this case. Thanks Brendan.
> I'm expecting that to be 'fun'.
Was that a pun? 🙂
1
Show replies

