[commit: ghc] coercible: Introduce coerce :: Coercible a b -> a -> b (17a868a)

git at git.haskell.org git at git.haskell.org
Fri Sep 13 23:48:21 CEST 2013


Repository : ssh://git@git.haskell.org/ghc

On branch  : coercible
Link       : http://ghc.haskell.org/trac/ghc/changeset/17a868afa169c52d8525a95cbed87b2fc12044c6/ghc

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

commit 17a868afa169c52d8525a95cbed87b2fc12044c6
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Fri Sep 13 18:40:36 2013 +0200

    Introduce coerce :: Coercible a b -> a -> b
    
    This is the result of the design at
    http://ghc.haskell.org/trac/ghc/wiki/NewtypeWrappers
    
    The goal is to be able to convert between, say [First Int] and [Last
    Int] with zero run-time overhead. To that end, we introduce a special
    two parameter type class Coercible whose instances are created
    automatically and on-the fly. This relies on and exploits the recent
    addition of roles to core.


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

17a868afa169c52d8525a95cbed87b2fc12044c6
 compiler/basicTypes/MkId.lhs      |   21 +++++-
 compiler/coreSyn/MkCore.lhs       |    8 +++
 compiler/deSugar/DsBinds.lhs      |   47 +++++++++++++-
 compiler/prelude/PrelInfo.lhs     |    2 +-
 compiler/prelude/PrelNames.lhs    |   15 ++++-
 compiler/prelude/TysWiredIn.lhs   |   27 ++++++++
 compiler/prelude/primops.txt.pp   |   56 ++++++++++++++++
 compiler/typecheck/TcErrors.lhs   |   86 ++++++++++++++++++++++--
 compiler/typecheck/TcEvidence.lhs |   38 +++++++++++
 compiler/typecheck/TcHsSyn.lhs    |   13 ++++
 compiler/typecheck/TcInteract.lhs |  130 ++++++++++++++++++++++++++++++++++++-
 compiler/typecheck/TcValidity.lhs |   10 +++
 12 files changed, 440 insertions(+), 13 deletions(-)

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

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 17a868afa169c52d8525a95cbed87b2fc12044c6



More information about the ghc-commits mailing list