[GHC] #15645: TypeChecking of Monad patterns incorrect with RebindableSyntax and OverloadedStrings

GHC ghc-devs at haskell.org
Fri Sep 14 09:58:36 UTC 2018


#15645: TypeChecking of Monad patterns incorrect with RebindableSyntax and
OverloadedStrings
-------------------------------------+-------------------------------------
        Reporter:  NeilMitchell      |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.6.1
       Component:  Compiler          |              Version:  8.4.3
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC rejects       |  Unknown/Multiple
  valid program                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by NeilMitchell):

 BTW, I'm happy to get the work done, if there's acceptance that it really
 is a bug, and what it should do. Implementation notes follow (only read
 them if we're agreed it is a bug, if not I'll transfer them to a
 proposal).

 There's still an open question of whether the `fromString` is injected
 only when you have `OverloadedStrings` and `RebindableSyntax` (and thus a
 user-controlled `fail`), or always for `OverloadedStrings` - my view is
 likely only when both are enabled. This would then be consistent with not
 desugaring pattern matches to `fromString`, since `patError` isn't user-
 controlled.

 My fix would be that `getFailFunction` and `failFunction` in `RnExpr.hs`
 should be changed so that if `OverloadedStrings` is enabled then the
 `fail_op` would be `fail . fromString` rather than just `fail` as it is
 now.

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


More information about the ghc-tickets mailing list