[GHC] #3990: UNPACK doesn't unbox data families

GHC ghc-devs at haskell.org
Sun Dec 29 13:55:12 UTC 2013


#3990: UNPACK doesn't unbox data families
--------------------------------------------+------------------------------
        Reporter:  rl                       |            Owner:
            Type:  bug                      |           Status:  new
        Priority:  low                      |        Milestone:  7.6.2
       Component:  Compiler                 |          Version:  7.0.3
      Resolution:                           |         Keywords:
Operating System:  Unknown/Multiple         |     Architecture:
 Type of failure:  Runtime performance bug  |  Unknown/Multiple
       Test Case:                           |       Difficulty:  Unknown
        Blocking:                           |       Blocked By:
                                            |  Related Tickets:
--------------------------------------------+------------------------------

Comment (by sjoerd_visscher):

 What about closed data families? GHC could check that every instance is
 unpackable. Then this would work:

 {{{
 data Nat = Z | S Nat

 data family Vec (size :: Nat) where
   Vec Z = Nil
   Vec (S n) = Cons {-# UNPACK #-} !Double {-# UNPACK #-} !(Vec n)
 }}}

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


More information about the ghc-tickets mailing list