
16 Apr
2016
16 Apr
'16
11:53 a.m.
Sorry for the question that probably is already answered somewhere, but i do not get it from the basic documentation i have looked at so far. Is monomorphism restriction really necessary, or is it just a convenience? In the example from A History of Haskell genericLength :: Num a => [b] -> a f xs = (len, len) where len = genericLength xs can't the monomorphism restriction be replaced with just adding the signature f :: Num a => [b] -> (a, a) ? If yes, are there other cases where there is no way to get the desired behavior without enabling the monomorphism restriction? Alexey.