[GHC] #10523: Add Monoid instance for IO

GHC ghc-devs at haskell.org
Mon Jun 15 04:08:04 UTC 2015


#10523: Add Monoid instance for IO
-------------------------------------+-------------------------------------
              Reporter:  Gabriel439  |             Owner:
                  Type:  feature     |            Status:  new
  request                            |         Milestone:
              Priority:  normal      |           Version:  7.10.1
             Component:  Compiler    |  Operating System:  Unknown/Multiple
              Keywords:              |   Type of failure:  None/Unknown
          Architecture:              |        Blocked By:
  Unknown/Multiple                   |   Related Tickets:
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------
 This is to add the following `Monoid` instance for `IO`:

 {{{#!hs
 instance Monoid a => Monoid (IO a) where
     mempty  = pure mempty

     mappend = liftA2 mappend
 }}}

 I originally proposed this instance on the libraries mailing list a while
 ago:

 https://mail.haskell.org/pipermail/libraries/2014-November/024310.html

 ... and the proposal was well-received so I would like to contribute the
 instance.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10523>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list