Saturday, February 1, 2014

Haskell Error 1

Invalid type signature: GetMax :: Ord a => [a] -> a
Should be of form <variable> :: <type>

This is because, the function 'GetMax' starts with capital case, it should be 'getMax'. In haskell function names shouldn't start with capital case, only module names can start with capital case.
Example: getMax :: (Ord a) => [a] -> a

No comments:

Post a Comment