[GHC] #12973: No levity-polymorphic arguments

GHC ghc-devs at haskell.org
Wed Dec 14 03:24:31 UTC 2016


#12973: No levity-polymorphic arguments
-------------------------------------+-------------------------------------
           Reporter:  goldfire       |             Owner:  goldfire
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:  8.2.1
          Component:  Compiler       |           Version:  8.1
           Keywords:                 |  Operating System:  Unknown/Multiple
  LevityPolymorphism                 |
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 As discussed in our
 [http://cs.brynmawr.edu/~rae/papers/2017/levity/levity.pdf draft paper] on
 levity polymorphism, you cannot have a levity-polymorphic argument. Here
 is an example:

 {{{#!hs
 {-# LANGUAGE RebindableSyntax, TypeInType, ExplicitForAll #-}

 module Bug where

 import qualified Prelude as P
 import GHC.Exts

 class Num (a :: TYPE r) where
   (+) :: a -> a -> a
   fromInteger :: P.Integer -> a

 foo :: forall (a :: TYPE r). Num a => a
 foo = 3 + 4
 }}}

 HEAD panics in `kindPrimRep`, but the code should be rejected.

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


More information about the ghc-tickets mailing list