[GHC] #10755: Add `MonadPlus IO` and `Alternative IO` instances

GHC ghc-devs at haskell.org
Mon Aug 17 08:13:08 UTC 2015


#10755: Add `MonadPlus IO` and `Alternative IO` instances
-------------------------------------+-------------------------------------
        Reporter:  hvr               |                   Owner:
            Type:  task              |                  Status:  patch
        Priority:  normal            |               Milestone:  7.12.1
       Component:  Core Libraries    |                 Version:
      Resolution:                    |                Keywords:  report-
                                     |  impact
Operating System:  Unknown/Multiple  |            Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:  Phab:D1148
-------------------------------------+-------------------------------------

Comment (by hvr):

 Replying to [comment:5 bgamari]:
 > +1 to putting these in `base-orphans`. It's unfortunate that people will
 need to update their dependency lists, but it seems like the right thing
 to do.

 Adding those to `base-orphans` is not the problem (and I'm +1 on that as
 well). The problem is with already released packages. Specifically,
 consider the following case:

  - A package `foo-0.1` relies on `transformer >= 0.4` to supply the
 `MonadPlus IO` instance.
  - Now a new `transformers-0.5` is released which lacks the instance.
  - So now `foo-0.1` breaks when using `base-4.8`+`transformers-0.5`.
  - `base-4.9` would however have the instance again and `foo-0.1` happens
 to compile again with `base-4.9`+`transformers-0.5`

 Now in order to fixup this breakage would need to add upper bounds to the
 `foo-0.1`, but the problem is we can either

  - add a `transformers < 0.5` bound to `foo-0.1`, which would block out
 the sensible `base-4.9`+`transformers-0.5` combination, or
  - add a `base < 4.9` bound to `foo-0.1`, which block
 `base-4.9`+`transformers-0.5` as well.

 What we would need to be able to do is to retrofit the constraint "`base
 >= 4.9 || transformers < 0.5`", but this requires cabal conditionals and
 automatic cabal flags, which can't be edited into a package retroactively
 (for good reason).

 If this specific constellation affects a very small amount of
 packages*versions, we can handle it by a combination of cabal-edits and
 interacting w/ the authors to upload point releases. Otherwise we're faced
 with some kind of amputation-dilemma (not sure if there's a better term
 for it: i.e. when we need to amputate healthy install-plan-limbs in order
 to save the Hackage-patient...).

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


More information about the ghc-tickets mailing list