Implement "roles" into GHC.
Roles are a solution to the GeneralizedNewtypeDeriving type-safety problem. Roles were first described in the "Generative type abstraction" paper, by Stephanie Weirich, Dimitrios Vytiniotis, Simon PJ, and Steve Zdancewic. The implementation is a little different than that paper. For a quick primer, check out Note [Roles] in Coercion. Also see http://ghc.haskell.org/trac/ghc/wiki/Roles and http://ghc.haskell.org/trac/ghc/wiki/RolesImplementation For a more formal treatment, check out docs/core-spec/core-spec.pdf. This fixes Trac #1496, #4846, #7148.
Showing
- compiler/basicTypes/DataCon.lhs 6 additions, 4 deletionscompiler/basicTypes/DataCon.lhs
- compiler/basicTypes/MkId.lhs 7 additions, 7 deletionscompiler/basicTypes/MkId.lhs
- compiler/cmm/SMRep.lhs 40 additions, 2 deletionscompiler/cmm/SMRep.lhs
- compiler/coreSyn/CoreLint.lhs 77 additions, 46 deletionscompiler/coreSyn/CoreLint.lhs
- compiler/coreSyn/CoreSubst.lhs 5 additions, 3 deletionscompiler/coreSyn/CoreSubst.lhs
- compiler/coreSyn/CoreUtils.lhs 10 additions, 6 deletionscompiler/coreSyn/CoreUtils.lhs
- compiler/coreSyn/ExternalCore.lhs 18 additions, 11 deletionscompiler/coreSyn/ExternalCore.lhs
- compiler/coreSyn/MkExternalCore.lhs 12 additions, 12 deletionscompiler/coreSyn/MkExternalCore.lhs
- compiler/coreSyn/PprExternalCore.lhs 43 additions, 17 deletionscompiler/coreSyn/PprExternalCore.lhs
- compiler/coreSyn/TrieMap.lhs 59 additions, 23 deletionscompiler/coreSyn/TrieMap.lhs
- compiler/deSugar/DsBinds.lhs 33 additions, 26 deletionscompiler/deSugar/DsBinds.lhs
- compiler/deSugar/DsForeign.lhs 1 addition, 1 deletioncompiler/deSugar/DsForeign.lhs
- compiler/deSugar/DsMeta.hs 71 additions, 35 deletionscompiler/deSugar/DsMeta.hs
- compiler/ghci/ByteCodeAsm.lhs 12 additions, 4 deletionscompiler/ghci/ByteCodeAsm.lhs
- compiler/hsSyn/Convert.lhs 17 additions, 2 deletionscompiler/hsSyn/Convert.lhs
- compiler/hsSyn/HsTypes.lhs 13 additions, 12 deletionscompiler/hsSyn/HsTypes.lhs
- compiler/hsSyn/HsUtils.lhs 1 addition, 1 deletioncompiler/hsSyn/HsUtils.lhs
- compiler/iface/BinIface.hs 1 addition, 0 deletionscompiler/iface/BinIface.hs
- compiler/iface/BuildTyCl.lhs 23 additions, 20 deletionscompiler/iface/BuildTyCl.lhs
- compiler/iface/IfaceSyn.lhs 83 additions, 45 deletionscompiler/iface/IfaceSyn.lhs
Loading
Please register or sign in to comment