Haskell point-free compilation type -


so i'm new haskell, playing around point free notation , came across issue. i'm in console:

> let c = (.)negate  > :t c  > (a -> integer) -> -> integer -> 

but negate takes number, why being constrained integer type?

this case of extended defaulting rules in ghci. :set -xnomonomorphismrestriction or do

> :set +m  -- multiline input in ghci > let c :: (num a) => (b -> a) -> b -> -> b |     c = (.) negate | > :t c num => (b -> a) -> b -> -> b 

Comments