[GHC] #11976: Error message mentions impredicative polymorphism

GHC ghc-devs at haskell.org
Sat Apr 23 11:02:02 UTC 2016


#11976: Error message mentions impredicative polymorphism
-------------------------------------+-------------------------------------
           Reporter:  Iceland_jack   |             Owner:
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  7.10.3
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 When we apply `Lens` to too many arguments in the `:kind` command we get a
 sensible error message

 {{{
 ghci> type Lens s a = forall f. Functor f => (a -> f a) -> (s -> f s)
 ghci> :kind Lens _ _
 Lens _ _ :: *
 ghci> :kind Lens _ _ _

 <interactive>:1:1: error:
     • Expecting one fewer argument to ‘Lens t0 t1’
       Expected kind ‘k0 -> k1’, but ‘Lens t0 t1’ has kind ‘*’
     • In the type ‘Lens _ _ _’
 }}}

 but use the same in a type signature or annotation and it complains about
 impredicative polymorphism

 {{{
 ghci> :t undefined :: Lens _ _ _

 <interactive>:1:1: error:
     • Illegal polymorphic type: Lens _ _1
       GHC doesn't yet support impredicative polymorphism
     • In the expression: undefined :: Lens _ _ _
 ghci> a :: Lens _ _ _; a = undefined

 <interactive>:6:1: error:
     Illegal polymorphic type: Lens _ _1
     GHC doesn't yet support impredicative polymorphism
 }}}

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


More information about the ghc-tickets mailing list