IO () as Monoid
Conal Elliott
conal at conal.net
Thu Mar 8 18:57:58 EST 2007
Is there a Monoid instance defined for IO () anywhere? I'm using the
following,
instance Monoid (IO ()) where { mempty = pure mempty; mappend = (*>) }
This definition follows a general form mentioned in
http://haskell.org/haskellwiki/TypeComposition,
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...
URL: http://www.haskell.org/pipermail/libraries/attachments/20070308/6f6aaab2/attachment.htm
More information about the Libraries
mailing list