function,haskell,types,monomorphism-restriction
As usual with cases where making a well-typed function point-free suddenly results in type errors about unfulfilled typeclass constraints, the ultimate cause of this is monomorphism restriction, enabled by default. You can solve this by either adding a type signature to mysum: mysum :: (Foldable f, Num a) => f...