Return specific type within Haskell
A function with signature Num a => a is expected to work for any type in the class Num. The implementation 5.0 :: Double just works for one type, not for all types of the class, so the compiler complains. An example of a generic function would be: square :: (Num a) => a -> … Read more