[commit: ghc] master: Make {-# UNPACK #-} work for type/data family invocations (1ee1cd4)

Simon Peyton Jones <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/1ee1cd4194555e498d05bfc391b7b0e635d11e29

>---------------------------------------------------------------

commit 1ee1cd4194555e498d05bfc391b7b0e635d11e29
Author: Simon Peyton Jones <[email protected]>
Date:   Sun Dec 23 15:38:48 2012 +0000

    Make {-# UNPACK #-} work for type/data family invocations
    
    This fixes most of Trac #3990.  Consider
      data family D a
      data instance D Double = CD Int Int
      data T = T {-# UNPACK #-} !(D Double)
    Then we want the (D Double unpacked).
    
    To do this we need to construct a suitable coercion, and it's much
    safer to record that coercion in the interface file, lest the in-scope
    instances differ somehow.  That in turn means elaborating the HsBang
    type to include a coercion.
    
    To do that I moved HsBang from BasicTypes to DataCon, which caused
    quite a few minor knock-on changes.
    
    Interface-file format has changed!
    
    Still to do: need to do knot-tying to allow instances to take effect
    within the same module.

 compiler/basicTypes/BasicTypes.lhs             |   51 ------
 compiler/basicTypes/DataCon.lhs                |   52 ++++++-
 compiler/basicTypes/MkId.lhs                   |  228 ++++++++++++++----------
 compiler/hsSyn/HsTypes.lhs                     |    1 +
 compiler/iface/BinIface.hs                     |   20 +--
 compiler/iface/BuildTyCl.lhs                   |   12 +-
 compiler/iface/IfaceSyn.lhs                    |   13 +-
 compiler/iface/MkIface.lhs                     |    8 +-
 compiler/iface/TcIface.lhs                     |   13 ++-
 compiler/main/PprTyThing.hs                    |    3 +-
 compiler/prelude/TysWiredIn.lhs                |    2 +-
 compiler/simplCore/Simplify.lhs                |    4 +-
 compiler/stranal/DmdAnal.lhs                   |    4 +-
 compiler/typecheck/TcRnDriver.lhs              |    2 +-
 compiler/typecheck/TcSplice.lhs                |   10 +-
 compiler/typecheck/TcTyClsDecls.lhs            |    6 +-
 compiler/vectorise/Vectorise/Generic/PData.hs  |    9 +-
 compiler/vectorise/Vectorise/Type/TyConDecl.hs |    4 +-
 18 files changed, 252 insertions(+), 190 deletions(-)


Diff suppressed because of size. To see it, use:

    git show 1ee1cd4194555e498d05bfc391b7b0e635d11e29
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.