
17 Aug
2013
17 Aug
'13
4:40 p.m.
Am 17.08.2013 22:31, schrieb Petr Pudlák:
Dear haskellers,
currently the instances are defined as
|instance (Monoid a,Monoid b) =>Monoid (a,b)where mempty = (mempty, mempty) (a1,b1) `mappend` (a2,b2) = (a1 `mappend` a2, b1 `mappend` b2)|
I think that this instance is correct, since it must hold forall x. mappend mempty x = x With your instance you get for x=undefined: mappend mempty undefined = (undefined, undefined) However, the "instance Monoid ()" is too lazy, such that it does not satisfy the identity law.