[GHC] #10365: Implement Semigroup as a superclass of Monoid Proposal (Phase 1)

GHC ghc-devs at haskell.org
Sun Oct 4 12:17:27 UTC 2015


#10365: Implement Semigroup as a superclass of Monoid Proposal (Phase 1)
-------------------------------------+-------------------------------------
        Reporter:  gidyn             |                Owner:  quchen
            Type:  feature request   |               Status:  patch
        Priority:  high              |            Milestone:  8.0.1
       Component:  libraries/base    |              Version:  7.10.1
      Resolution:                    |             Keywords:  report-impact
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D1284
-------------------------------------+-------------------------------------

Comment (by bgamari):

 I realize that this has
 [[https://mail.haskell.org/pipermail/libraries/2015-May/025648.html|all
 been discussed before]] but I do wonder whether we really ''need'' to fold
 in `Data.List.NonEmpty` at this juncture? It does not appear to be a
 widely used type in practice and the interface has a few quirks. What do
 we gain by it being in `base`?

 The reason I ask is that I've noticed that `NonEmpty` introduces yet more
 partial functions to `base`. For instance, why must `words` have type
 `NonEmpty Char -> NonEmpty String`? Why not `NonEmpty Char -> [String]`?
 After all it seems quite reasonable for a non-empty string to nevertheless
 contain no words. Given that these are design decisions that reasonable
 people may disagree over, might it be best just to defer them packages
 outside of `base`?

 Sorry bringing this up so long after the initial consideration but I just
 wanted to make sure we have thoroughly considered this angle.

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


More information about the ghc-tickets mailing list