I am starting to learn Haskell, and although it was great, some features of a class-like system led to great disappointment during projects with an entire number of focused tasks. As a concrete example, if I open ghci and check the type of addition, I get:
Prelude> :t (+)
(+) :: Num a => a -> a -> a
A complement is super-generic, Numis the most general type of class, etc., so everything makes sense. But if I declare some function as a complement, and then check the type of this function, the type class reduces to Integer!
Prelude> let add = (+)
Prelude> :t add
add :: Integer -> Integer -> Integer
So ... what's going on?
source
share