Re: [GHC] #1311: newtypes of unboxed types disallowed - documentation bug and/or feature request

#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 goldfire): I think this will be quite easy, actually. You're hunting in all the right places. `getInitialKind` does indeed assume a result of kind `*`. (A kind sig ''can'' be provided via `newtype Blah :: * -> * where ...` as if you're defining a GADT. That is, GADT syntax works with newtypes just fine.) But I don't think anyone gets hurt if you assume that the return kind is `TYPE v` for a fresh levity metavariable `v`. You may need to unify that result kind with `*` in the datatype case somewhere. You'd need to check that the result kind of the newtype matches the kind of the representation type. I think this would happen in `kcConDecl`. One annoying bit is that we have no surface syntax (other than `TYPE 'Unlifted`) for `#`. I suppose you could add `type UnliftedType = TYPE 'Unlifted` in `Data.Kind` if you felt it worthwhile. I really don't think it would be much harder than this. Go for it! :) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/1311#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC