Can you overload + in haskell?

Yes (+) is part of the Num typeclass, and everyone seems to feel you can’t define (*) etc for your type, but I strongly disagree. newtype Pair a b = Pair (a,b) deriving (Eq,Show) I think Pair a b would be nicer, or we could even just use the type (a,b) directly, but… This is … Read more

What part of Hindley-Milner do you not understand?

The horizontal bar means that “[above] implies [below]”. If there are multiple expressions in [above], then consider them anded together; all of the [above] must be true in order to guarantee the [below]. : means has type ∈ means is in. (Likewise ∉ means “is not in”.) Γ is usually used to refer to an … Read more