
12 Nov
2018
12 Nov
'18
10:07 a.m.
Oleg Grenrus wrote:
Monoid doesn't have fromInteger -like function. For example, we don't have FromString b => FromString (a -> b) instance.
Monoid does have `mempty` though, with the unfortunate property that mempty [1,2] /= mempty `mappend` [1,2] But I'm less worried about this than in the case of Num; I occasionally copy formulas from a CAS into Haskell code and then add the missing * operations manually; I estimate that about half of the time I miss one instance and am rescued by the type checker. So to me, `2 (x + y)` no longer being a type error would have practical implications. -1 on the proposal from me. Cheers, Bertram