[GHC] #11650: Documentation does not mention that default definitions for Alternative(some, many) can easily blow up

GHC ghc-devs at haskell.org
Sat Feb 27 18:09:35 UTC 2016


#11650: Documentation does not mention that default definitions for
Alternative(some, many) can easily blow up
-------------------------------------+-------------------------------------
        Reporter:  bgamari           |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Documentation     |              Version:  7.10.3
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by RyanGlScott):

 Replying to [comment:8 ekmett]:
 > I mostly lack a preference here, but if we make it match the semantics
 of `Proxy` it'd avoid complications later on if we were to ever decide to
 make the leap and unify `(:*:)` with `Product`, `(:+:)` with `Sum`, `U1`
 with `Proxy`, etc. rather than retain two of each.

 That's a pretty convincing argument. It does seem like it would save us
 work in the long run to make `U1` as `Proxy`-like as possible (and
 similarly with other `GHC.Generics` datatypes), so I'll do this before 8.0
 lands.

 Some questions we should answer:

 1. Do change `U1`'s derived `Eq`, `Ord`, `Read`, and `Show` instances
 (which have been around for a while) and manually implement them with lazy
 pattern-matching? That seems like the sensible thing to do, although it
 would be a subtle semantic change.
 2. Do we add all of the extra instances which `Proxy` has but `U1`
 doesn't? (`Enum`, `Bounded`, `Ix`, etc.) My gut reaction is to punt on
 this and only add them if someone requests it. Plus, if we decide to merge
 `U1` and `Proxy`, it will be a moot point after that.

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


More information about the ghc-tickets mailing list