[GHC] #12980: Unlifted class method rejected

GHC ghc-devs at haskell.org
Thu Dec 15 01:57:48 UTC 2016


#12980: Unlifted class method rejected
-------------------------------------+-------------------------------------
           Reporter:  goldfire       |             Owner:  goldfire
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.1
           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:
-------------------------------------+-------------------------------------
 If I say

 {{{#!hs
 class C a where
   meth :: Array# a
 }}}

 I get

 {{{
     • Expecting a lifted type, but ‘Array# a’ is unlifted
     • In the type signature: meth :: Array# a
       In the class declaration for ‘C’
 }}}

 This definition looks OK to me. I don't see why we can't have an unlifted
 member of a class.

 (As @oerjan points out in comment:25:ticket:12708, we can't have a
 ''levity-polymorphic'' class member, but this is solidly levity-
 monomorphic.)

 I'm happy to lift this restriction in ongoing work in this area, but I
 wanted to double-check before doing so.

 For the record, the same error occurs even when the class has more than
 one member, so it's not the no-unlifted-newtypes restriction.

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


More information about the ghc-tickets mailing list