[GHC] #12464: Add `instance Semigroup a => Semigroup (IO a)`
GHC
ghc-devs at haskell.org
Fri Oct 14 14:33:10 UTC 2016
#12464: Add `instance Semigroup a => Semigroup (IO a)`
-------------------------------------+-------------------------------------
Reporter: Iceland_jack | Owner:
Type: feature request | Status: patch
Priority: normal | Milestone:
Component: Core Libraries | Version: 8.0.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D2588
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ryan Scott <ryan.gl.scott@…>):
In [changeset:"8c6a3d68c0301bb985aa2a462936bbcf7584ae9c/ghc" 8c6a3d6/ghc]:
{{{
#!CommitTicketReference repository="ghc"
revision="8c6a3d68c0301bb985aa2a462936bbcf7584ae9c"
Add missing Semigroup instances for Monoidal datatypes in base
Summary:
There are currently three datatypes that are exposed in `base` that have
`Monoid` instances, but no `Semigroup` instances:
* `IO`
* `Event` (from `GHC.Event`)
* `Lifetime` (from `GHC.Event`)
(There is also `EventLifetime` in `GHC.Event.Internal`, but it is not
exported
directly, so I didn't bother with it.)
Adding the `Semigroup` instances for these types directly in the modules
in
which they're defined resulted in some horrific import cycles, so I opted
to
take the easy approach of defining all of these instances in
`Data.Semigroup`.
(When `Semigroup` becomes a superclass of `Monoid`, these instances will
have
to be moved somehow.)
Fixes #12464.
Test Plan: It compiles
Reviewers: hvr, ekmett, austin, bgamari
Reviewed By: ekmett
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2588
GHC Trac Issues: #12464
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12464#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list