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

GHC ghc-devs at haskell.org
Fri Sep 14 08:45:06 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):

 The use case is for `Prelude` replacement modules that seek to switch the
 type of `[Char]` to something like `Text`. A standard way is to define
 your own `Monad`/`MonadFail` class which has `fail :: Text -> m a` in it.
 If that class is forced to have `fail :: [Char] -> m a` instead (as it is
 now) then all your users have to implement a function working on `[Char]`,
 even though for everything else in your custom library, they never see
 `[Char]` and your custom `Prelude` has no other `[Char]` related
 functions.

 In the particular example I'm working on, the `Char` type has been
 eliminated entirely, aside from the `fail` function.

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


More information about the ghc-tickets mailing list