
#1311: newtypes of unboxed types disallowed - documentation bug and/or feature request -------------------------------------+------------------------------------- Reporter: Isaac Dupree | Owner: osa1 Type: feature request | Status: new Priority: low | Milestone: ⊥ Component: Compiler | Version: 7.7 Resolution: | 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: | -------------------------------------+------------------------------------- Comment (by alexbiehl): I'm sorry, I falsely implied the context of this thread. I think the general idea is described in https://ghc.haskell.org/trac/ghc/wiki/UnliftedDataTypes. I noticed the conversation here got stalled so I picked up and experimented where osa1 left: https://ghc.haskell.org/trac/ghc/ticket/1311#comment:12 describes a construct like the following: {{{ type Unlifted = TYPE 'UnliftedRep newtype Blah :: TYPE 'IntRep where Blah :: Int# -> Blah data T :: Unlifted where T :: Int -> Int -> T }}} Which allows: 1. newtype declaration over unlifted types 2. data declarations which are represented through an unlifted pointer (do not contain bottom) The approach mentioned on `UnliftedDataTypes` page introduces a new keyword `unlifted`. This approach differs in that we give the unlifted representation through an explicit kind signature on the newtype/data type instead of a new syntax. And that is what the patch allows in https://ghc.haskell.org/trac/ghc/ticket/1311#comment:18 enables us to write. I can formulate a proposal next week. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/1311#comment:20 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler