IO () as Monoid

Conal Elliott conal at
Thu Mar 8 18:57:58 EST 2007

Is there a Monoid instance defined for IO () anywhere?  I'm using the

instance Monoid (IO ()) where { mempty = pure mempty; mappend = (*>) }

This definition follows a general form mentioned in,

instance (Applicative f, Monoid a) => Monoid (f a) where
  mempty = pure mempty
  mappend = (*>)

without the conflicts (overlapping instances) introduced by this definition.

   - Conal
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the Libraries mailing list