Kind-polymorphic type family accepts unlifted type arguments
The following code is accepted by ghc-7.8.2 and ghc-7.6.3:
{-# LANGUAGE TypeFamilies, MagicHash, PolyKinds #-}
import GHC.Exts
type family F (a :: k) :: *
type instance F Int# = ()
In nearly all other places, it seems that unlifted types are explicitly forbidden. I'm also not allowed to actually apply F
to Int#
after defining the type family like this. So I think the compiler should probably reject the type instance
.
(BTW, is it actually clear that using #
as an argument kind to a type family or as an index kind for a GADT is in any way harmful?)
Trac metadata
Trac field | Value |
---|---|
Version | 7.8.2 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler (Type checker) |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |