
John Hughes
Ambiguous type variable `a' in the constraint: `Ord a' arising from use of `Data.Set.insert' at Pretty.hs:28:11-20 Possible cause: the monomorphism restriction applied to the following: addToSet :: a -> Data.Set.Set a -> Data.Set.Set a Probable fix: give these definition(s) an explicit type signature or use -fno-monomorphism-restriction
Well, is it OK? From the type-checker's point of view, yes, But have you lost sharing?
Yes, I have lost sharing, but then again, sharing is impossible here anyway. In fact, the monomorphism restriction wanted to force sharing, but the types indicated it was not possible, hence the error. :-) What the M-R was complaining about, is my having eta-reduced a definition into completely point-free style. Regards, Malcolm