
2 Jul
2009
2 Jul
'09
6:32 p.m.
It is claimed that making ++ become another name for the Monoid mappend operation "will break some Haskell 98 code" such as append = (++) That example can easily be fixed by adding a type signature, no? append :: [a] -> [a] -> [a] append = (++) In ghci, at any rate, using mappend instead of (++), the first is rejected, but the sceond works perfectly. The nice thing about this is that the code _with_ the type signature is perfectly legal Haskell 98, so the fix leaves you with something that works with either reading of (++). Do we have any other uses of ++ that would be hard to fix by adding a type signature?