Skip to content

Allow existentials to UNPACK

Consider

data T a where
  MkT :: b -> (b->a) -> T a

data Wuggle where
  MkW :: {-# UNPACK #-} !T Int -> Wuggle

Here MkT has an existential, but there is really no reason that it can't unpack into the data constructor for MkW. But it is currently rejected.

Edited by Simon Peyton Jones
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information