[GHC] #10751: Implement Phase 1 of MonadFail Proposal (MFP)

#10751: Implement Phase 1 of MonadFail Proposal (MFP) -------------------------------------+------------------------------------- Reporter: hvr | Owner: Type: task | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.10.2 Keywords: report- | Operating System: Unknown/Multiple impact | Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Revisions: | -------------------------------------+------------------------------------- See also - https://www.reddit.com/r/haskell/comments/3a1o06/monadfail_proposal_mfp/ TODO: At this point this ticket is mostly a reminder that stuff may need to be done for GHC 7.12 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10751 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10751: Implement Phase 1 of MonadFail Proposal (MFP) -------------------------------------+------------------------------------- Reporter: hvr | Owner: Type: task | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.10.2 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: -------------------------------------+------------------------------------- Description changed by simonpj: Old description:
See also
- https://www.reddit.com/r/haskell/comments/3a1o06/monadfail_proposal_mfp/
TODO: At this point this ticket is mostly a reminder that stuff may need to be done for GHC 7.12
New description: See also - https://www.reddit.com/r/haskell/comments/3a1o06/monadfail_proposal_mfp/ TODO: At this point this ticket is mostly a reminder that stuff may need to be done for GHC 7.12 David Luposchainsky [ https://mail.haskell.org/pipermail/ghc- devs/2015-August/009664.html says that he plans to work on it]. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10751#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10751: Implement Phase 1 of MonadFail Proposal (MFP) -------------------------------------+------------------------------------- Reporter: hvr | Owner: Type: task | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.10.2 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: -------------------------------------+------------------------------------- Description changed by simonpj: Old description:
See also
- https://www.reddit.com/r/haskell/comments/3a1o06/monadfail_proposal_mfp/
TODO: At this point this ticket is mostly a reminder that stuff may need to be done for GHC 7.12
David Luposchainsky [ https://mail.haskell.org/pipermail/ghc- devs/2015-August/009664.html says that he plans to work on it].
New description: See also - https://www.reddit.com/r/haskell/comments/3a1o06/monadfail_proposal_mfp/ TODO: At this point this ticket is mostly a reminder that stuff may need to be done for GHC 7.12 David Luposchainsky [https://mail.haskell.org/pipermail/ghc- devs/2015-August/009664.html says that he plans to work on it]. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10751#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10751: Implement Phase 1 of MonadFail Proposal (MFP) -------------------------------------+------------------------------------- Reporter: hvr | Owner: Type: task | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.10.2 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: -------------------------------------+------------------------------------- Comment (by quchen): Current status: - Warnings are issued for missing MonadFail instances. These warnings are on by default and can be toggled with a flag. - The (->)r Monad doesn't yield the correct error message yet: it displays as "m r" in the "missing MonadFail" message. - There is a flag to turn on the actual desugaring. It's turned off by default, but can be used to get a hard error if something's been forgotten. - The testsuite has been mostly fixed (not sure whether the failing tests are our fault, didn't check it yet) - We have lots of WIP commits that aren't very good versioning practice, so the actual patch will need to be squashed down to a handful of useful ones. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10751#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10751: Implement Phase 1 of MonadFail Proposal (MFP) -------------------------------------+------------------------------------- Reporter: hvr | Owner: Type: task | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.2 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: -------------------------------------+------------------------------------- Comment (by quchen): Draft submitted to Phab: https://phabricator.haskell.org/D1248 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10751#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10751: Implement Phase 1 of MonadFail Proposal (MFP) -------------------------------------+------------------------------------- Reporter: hvr | Owner: quchen Type: task | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.2 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: -------------------------------------+------------------------------------- Changes (by hvr): * owner: => quchen -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10751#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10751: Implement Phase 1 of MonadFail Proposal (MFP) -------------------------------------+------------------------------------- Reporter: hvr | Owner: quchen Type: task | Status: patch Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.2 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: -------------------------------------+------------------------------------- Changes (by hvr): * status: new => patch -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10751#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10751: Implement Phase 1 of MonadFail Proposal (MFP) -------------------------------------+------------------------------------- Reporter: hvr | Owner: quchen Type: task | Status: patch Priority: highest | Milestone: 8.0.1 Component: Compiler | Version: 7.10.2 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:D1248 -------------------------------------+------------------------------------- Changes (by hvr): * priority: normal => highest * differential: => Phab:D1248 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10751#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10751: Implement Phase 1 of MonadFail Proposal (MFP) -------------------------------------+------------------------------------- Reporter: hvr | Owner: quchen Type: task | Status: patch Priority: highest | Milestone: 8.0.1 Component: Compiler | Version: 7.10.2 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:D1248 -------------------------------------+------------------------------------- Comment (by goldfire): Sorry for coming to the party late, but is there an up-to-date proposal I could read here? The link in the original post goes to a reddit page, which has links to an "original propsal" and an "update 1", both of which seem to have open questions, and neither of which are editable. I don't have any objections -- just trying to stay informed. Thanks! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10751#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10751: Implement Phase 1 of MonadFail Proposal (MFP) -------------------------------------+------------------------------------- Reporter: hvr | Owner: quchen Type: task | Status: patch Priority: highest | Milestone: 8.0.1 Component: Compiler | Version: 7.10.2 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:D1248 -------------------------------------+------------------------------------- Comment (by quchen): Discussion of the initial proposal went pretty dead soon, and there was close to no response for the update, so we left it at that (considering the few suggestions we got and that people actually cared about) and fleshed it out on IRC. We modified the transitional strategy based on what we had a bit, and it's in https://github.com/quchen/articles/blob/master/monad_fail.md#transitional- strategy, which is what I'm implementing right now. Objections like the purpose of failure - such exception vs. error state - are orthogonal to the proposal, whose main goal by a huge margin is getting fail out of Monad. We can revisit such issues when MonadFail is established, e.g. by adding a new function to the MonadFail class that is called by the compiler, and one that's supposed to be used by the users explicitly. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10751#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10751: Implement Phase 1 of MonadFail Proposal (MFP) -------------------------------------+------------------------------------- Reporter: hvr | Owner: quchen Type: task | Status: patch Priority: highest | Milestone: 8.0.1 Component: Compiler | Version: 7.10.2 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:D1248 -------------------------------------+------------------------------------- Changes (by simonpj): * cc: core-libraries-committee, ekmett (added) Comment: Just to be clear, this is a Core Libraries Committee matter, so whatever the proposal is, it should be signed off by them. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10751#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10751: Implement Phase 1 of MonadFail Proposal (MFP) -------------------------------------+------------------------------------- Reporter: hvr | Owner: quchen Type: task | Status: patch Priority: highest | Milestone: 8.0.1 Component: Compiler | Version: 7.10.2 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:D1248 -------------------------------------+------------------------------------- Comment (by ekmett): My sense is that support within the committee or this proposal is very high, based on various discussions. I will however, take a moment to formally poll for objections within the committee just to make absolutely sure before I commit to signing off. That said, would it be possible to move the proposal from a github page to the Haskell Wiki for posterity? That would make it easier to express questions about minor points, e.g. whether `ViewPatterns`/`PatternSynonyms` should always be considered failable or if they should only be considered failable if their right hand side is. e.g. {{{ pattern Foo = ((),()) }}} is clearly an unfailable pattern. as is {{{ foo (snd -> x) = ... }}} as 'x' is unfailable. These compose for useful patterns like {{{ pattern Polar x y <- (magnitude &&& phase -> (x,y)) where Polar x y = mkPolar x y }}} Those items there are probably the primary sticking point I have personally, but in broad strokes I personally absolutely adore this proposal. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10751#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10751: Implement Phase 1 of MonadFail Proposal (MFP) -------------------------------------+------------------------------------- Reporter: hvr | Owner: quchen Type: task | Status: patch Priority: highest | Milestone: 8.0.1 Component: Compiler | Version: 7.10.2 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:D1248 -------------------------------------+------------------------------------- Comment (by quchen):
would it be possible to move the proposal from a github page to the Haskell Wiki for posterity?
Of course, I should have done that earlier. I'll get to it within a few hours. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10751#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10751: Implement Phase 1 of MonadFail Proposal (MFP) -------------------------------------+------------------------------------- Reporter: hvr | Owner: quchen Type: task | Status: patch Priority: highest | Milestone: 8.0.1 Component: Compiler | Version: 7.10.2 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:D1248 -------------------------------------+------------------------------------- Comment (by quchen): Wiki entry created: https://wiki.haskell.org/MonadFail_Proposal -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10751#comment:14 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10751: Implement Phase 1 of MonadFail Proposal (MFP) -------------------------------------+------------------------------------- Reporter: hvr | Owner: quchen Type: task | Status: patch Priority: highest | Milestone: 8.0.1 Component: Compiler | Version: 7.10.2 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:D1248 -------------------------------------+------------------------------------- Changes (by spl): * cc: spl (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10751#comment:15 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10751: Implement Phase 1 of MonadFail Proposal (MFP) -------------------------------------+------------------------------------- Reporter: hvr | Owner: quchen Type: task | Status: patch Priority: highest | Milestone: 8.0.1 Component: Compiler | Version: 7.10.2 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:D1248 -------------------------------------+------------------------------------- Comment (by spl): I worked a bit on the wiki proposal. I think it would be good to indicate (1) which {{{MonadFail}}} instances will be created and (2) which types with {{{Monad}}} instances will not have {{{MonadFail}}} instances. Since this change affects a number of important packages, those packages should probably be included. Also, I'm not clear on the conclusion for having {{{Monad}}} vs. {{{Applicative}}} as the superclass constraint on {{{MonadFail}}}. I tried to develop the discussion text on this a bit. Since we're getting {{{ApplicativeDo}}} soon, I think it would be useful to work out whether and how these two features are related. I didn't see anything on ApplicativeDo referring to the desugaring of pattern matching. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10751#comment:16 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10751: Implement Phase 1 of MonadFail Proposal (MFP)
-------------------------------------+-------------------------------------
Reporter: hvr | Owner: quchen
Type: task | Status: patch
Priority: highest | Milestone: 8.0.1
Component: Compiler | Version: 7.10.2
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:D1248
-------------------------------------+-------------------------------------
Comment (by Herbert Valerio Riedel

#10751: Implement Phase 1 of MonadFail Proposal (MFP)
-------------------------------------+-------------------------------------
Reporter: hvr | Owner: quchen
Type: task | Status: patch
Priority: highest | Milestone: 8.0.1
Component: Compiler | Version: 7.10.2
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:D1248
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#10751: Implement Phase 1 of MonadFail Proposal (MFP) -------------------------------------+------------------------------------- Reporter: hvr | Owner: quchen Type: task | Status: closed Priority: highest | Milestone: 8.0.1 Component: Compiler | Version: 7.10.2 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:D1248 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10751#comment:19 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10751: Implement Phase 1 of MonadFail Proposal (MFP) -------------------------------------+------------------------------------- Reporter: hvr | Owner: quchen Type: task | Status: closed Priority: highest | Milestone: 8.0.1 Component: Compiler | Version: 7.10.2 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:D1248 Wiki Page: | prime:Libraries/Proposals/MonadFail| -------------------------------------+------------------------------------- Changes (by hvr): * wikipage: => prime:Libraries/Proposals/MonadFail -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10751#comment:20 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10751: Implement Phase 1 of MonadFail Proposal (MFP)
-------------------------------------+-------------------------------------
Reporter: hvr | Owner: quchen
Type: task | Status: closed
Priority: highest | Milestone: 8.0.1
Component: Compiler | Version: 7.10.2
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:D1248
Wiki Page: |
prime:Libraries/Proposals/MonadFail|
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#10751: Implement Phase 1 of MonadFail Proposal (MFP)
-------------------------------------+-------------------------------------
Reporter: hvr | Owner: quchen
Type: task | Status: closed
Priority: highest | Milestone: 8.0.1
Component: Compiler | Version: 7.10.2
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:D1248
Wiki Page: |
prime:Libraries/Proposals/MonadFail|
-------------------------------------+-------------------------------------
Comment (by Herbert Valerio Riedel

#10751: Implement Phase 1 of MonadFail Proposal (MFP)
-------------------------------------+-------------------------------------
Reporter: hvr | Owner: quchen
Type: task | Status: closed
Priority: highest | Milestone: 8.0.1
Component: Compiler | Version: 7.10.2
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:D1248
Wiki Page: |
prime:Libraries/Proposals/MonadFail|
-------------------------------------+-------------------------------------
Comment (by Herbert Valerio Riedel

#10751: Implement Phase 1 of MonadFail Proposal (MFP)
-------------------------------------+-------------------------------------
Reporter: hvr | Owner: quchen
Type: task | Status: closed
Priority: highest | Milestone: 8.0.1
Component: Compiler | Version: 7.10.2
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:D1248
Wiki Page: |
prime:Libraries/Proposals/MonadFail|
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#10751: Implement Phase 1 of MonadFail Proposal (MFP) -------------------------------------+------------------------------------- Reporter: hvr | Owner: quchen Type: task | Status: closed Priority: highest | Milestone: 8.0.1 Component: Compiler | Version: 7.10.2 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:D1248 Wiki Page: | prime:Libraries/Proposals/MonadFail| -------------------------------------+------------------------------------- Comment (by bgamari): Renaming merged to `ghc-8.0`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10751#comment:25 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC