[GHC] #11333: GHCi does not discharge satisfied constraints

GHC ghc-devs at haskell.org
Wed Jan 6 18:20:37 UTC 2016


#11333: GHCi does not discharge satisfied constraints
---------------------------------+----------------------------------------
        Reporter:  Iceland_jack  |                Owner:
            Type:  bug           |               Status:  new
        Priority:  normal        |            Milestone:
       Component:  Compiler      |              Version:  8.1
      Resolution:                |             Keywords:
Operating System:  Linux         |         Architecture:  Unknown/Multiple
 Type of failure:  Other         |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:                |  Differential Rev(s):
       Wiki Page:                |
---------------------------------+----------------------------------------

Comment (by Iceland_jack):

 This error message can be improved, mention `TypeApplications` as a
 possible cause alone with monom.

 {{{#!hs
 Prelude> :set -XTypeApplications
 Prelude> data A
 Prelude> :t (==) @A
 (==) @A :: Eq A => A -> A -> Bool
 Prelude> a = (==) @A

 <interactive>:4:1: error:
     • No instance for (Eq A) arising from a use of ‘==’
     • When instantiating ‘a’, initially inferred to have
       this overly-general type:
         Eq A => A -> A -> Bool
       NB: This instantiation can be caused by the monomorphism
 restriction.
 }}}


 `==@A` here is also not desirable.

 {{{#!hs
 % ghci -ignore-dot-ghci
 GHCi, version 8.1.20160102: http://www.haskell.org/ghc/  :? for help
 Prelude> data A
 Prelude> :t (==) @A

 <interactive>:1:1: error:
     Pattern syntax in expression context: ==@A
     Did you mean to enable TypeApplications?
 }}}

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


More information about the ghc-tickets mailing list