[GHC] #14992: Allow existentials to UNPACK

#14992: Allow existentials to UNPACK -------------------------------------+------------------------------------- Reporter: simonpj | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 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: -------------------------------------+------------------------------------- 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. Fixing this would require quite a bit of new plumbing. E.g. the existential type variable of the worker and wrapper would differ, which is not true today. But morally it's the Right Thing. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14992 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14992: Allow existentials to UNPACK -------------------------------------+------------------------------------- Reporter: simonpj | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Resolution: duplicate | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * status: new => closed * resolution: => duplicate Old description:
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.
Fixing this would require quite a bit of new plumbing. E.g. the existential type variable of the worker and wrapper would differ, which is not true today. But morally it's the Right Thing.
New description: 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. -- Comment: Ugh. Duplicate of #10016 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14992#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC