[GHC] #10048: {-# UNPACK #-} support for size-indexed types

GHC ghc-devs at haskell.org
Fri Jan 30 19:40:43 UTC 2015


#10048: {-# UNPACK #-} support for size-indexed types
-------------------------------------+-------------------------------------
              Reporter:  dfeuer      |             Owner:
                  Type:  feature     |            Status:  new
  request                            |         Milestone:
              Priority:  normal      |           Version:  7.11
             Component:  Compiler    |  Operating System:  Unknown/Multiple
              Keywords:              |   Type of failure:  None/Unknown
          Architecture:              |        Blocked By:
  Unknown/Multiple                   |   Related Tickets:
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------
 I don't know too much of the theory, but it seems to me that `{-# UNPACK
 #-}` should be able to work for something like this:

 {{{#!hs
 data Tup (l::[*]) where
     Nil  :: HList '[]
     Cons :: e -> {-# UNPACK #-} !(HList l) -> HList (e ': l)
 }}}

 This is essentially just `HList` from the `HList` package but strict in
 the second `Cons` argument. What I would want is for `Tup '[a,b,c]` to be
 represented in just the same way as `(a,b,c)`. When possible, I'd want the
 getters/setters/lenses to be optimized to index into the unpacked
 structure rather than walking along it.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10048>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list