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

#10755: Add `MonadPlus IO` and `Alternative IO` instances -------------------------------------+------------------------------------- Reporter: hvr | Owner: Type: task | Status: new Priority: normal | Milestone: 7.12.1 Component: Core | Version: Libraries | Keywords: report- | Operating System: Unknown/Multiple impact | Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Revisions: | -------------------------------------+------------------------------------- Cloned and adapted from #9588: ---- The following 2 instances are currently Orphans in `transformers` but shall be defined in `base` instead: {{{#!hs instance MonadPlus IO instance Alternative IO }}} This proposal by SPJ already passed the CLC back in April and only needs implementing. I'll submit a patch shortly to Phab ---- This needs coordination w/ Ross as `transformers` must not define the same instances for new enough `base` versions. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10755 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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 -------------------------------------+------------------------------------- Changes (by hvr): * status: new => patch * differential: => Phab:D1148 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10755#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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 RyanGlScott): Note that the [http://hub.darcs.net/ross/transformers/patch/4af2ebe00671e3e20c5ce8edde8027a... upstream version] of `transformers` has already removed these orphan instances. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10755#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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:2 RyanGlScott]:
Note that the [http://hub.darcs.net/ross/transformers/patch/4af2ebe00671e3e20c5ce8edde8027a... upstream version] of `transformers` has already removed these orphan instances.
Oh, didn't notice... however that implies a major version bump for the next `transformer`s package. It'd better if `transformers` kept providing those orphan instances to smooth over the transition for already released package versions... let's hope this doesn't affect too many... :-/ -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10755#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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 RyanGlScott): If removing them from `transformers` causes too much heartburn, I'd be fine with asking Ross to put them back. My rationale when making that pull request was that putting orphan `IO` instances in a library about monad transformers didn't make much sense, and probably belong somewhere like `base-orphans` instead. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10755#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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 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. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10755#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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

#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 -------------------------------------+------------------------------------- Changes (by bergmark): * cc: bergmark (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10755#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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 ekmett): I think the ideal situation would be to have `transformers` continue to export those instances conditional on the version of `base`. This would ensure that the maximal number of versions of `base` work with the maximal number of versions of `transformers`, rather than inducing an unneeded gate function on what works with what. These sorts of gotchas are the things that drive away users, so it is worth spending the time to get this right. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10755#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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 -------------------------------------+------------------------------------- Changes (by RyanGlScott): * cc: ross (added) Comment: While I don't want to cause unnecessary pain for users, I have to wonder about the placement of the instances in `transformers`. Currebtly, they're located in `Control.Monad.Trans.Error`, which has been deprecated for a while. If users want to backport these new `IO` instances in their code, they'll have to reach for a module which GHC will warn is deprecated, which doesn't feel satisfying. Perhaps we could move the orphan instances to a different module in `transformers`, reexport it from `Control.Monad.Trans.Error`, and tell users to use the new module from here on out for conpatibility purposes? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10755#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10755: Add `MonadPlus IO` and `Alternative IO` instances -------------------------------------+------------------------------------- Reporter: hvr | Owner: Type: task | Status: patch Priority: normal | Milestone: 8.0.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 Rev(s): Phab:D1148 -------------------------------------+------------------------------------- Comment (by RyanGlScott): The orphan `MonadPlus IO` and `Alternative IO` instances are back in the upstream version of `transformers` (guarded by `#ifdef`s so that they won't be defined in GHC 7.11 and later), so that should no longer be an issue as far as this ticket is concerned. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10755#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10755: Add `MonadPlus IO` and `Alternative IO` instances
-------------------------------------+-------------------------------------
Reporter: hvr | Owner:
Type: task | Status: patch
Priority: normal | Milestone: 8.0.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 Rev(s): Phab:D1148
-------------------------------------+-------------------------------------
Comment (by Austin Seipp

#10755: Add `MonadPlus IO` and `Alternative IO` instances -------------------------------------+------------------------------------- Reporter: hvr | Owner: Type: task | Status: closed Priority: normal | Milestone: 8.0.1 Component: Core Libraries | Version: Resolution: fixed | 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:D1148 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed Comment: This is done. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10755#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC