Haskell horrors
May. 28th, 2018 04:53 amMonomorphism restriction.
-- This yields f1 :: (Show x) => x -> String f1 x = show x -- But this doesn't. Instead, f2 :: () -> String f2 = \x -> show x -- ...but we can fix that with an explicit type signature. f3 :: (Show a) => a -> String f3 = \x -> show x -- Similarly this produces () -> String f4 = show -- ...but this is allowed f5 :: (Show a) => a -> String f5 = show