[commit: ghc] wip/branchedness: Add explaining comment (d7c6a64)

git at git.haskell.org git at git.haskell.org
Sun Aug 2 17:44:50 UTC 2015


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

On branch  : wip/branchedness
Link       : http://ghc.haskell.org/trac/ghc/changeset/d7c6a64d9f34d1fa6be08857c8c6c85d6a0b61f2/ghc

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

commit d7c6a64d9f34d1fa6be08857c8c6c85d6a0b61f2
Author: Gabor Greif <ggreif at gmail.com>
Date:   Sun Aug 2 19:29:46 2015 +0200

    Add explaining comment


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

d7c6a64d9f34d1fa6be08857c8c6c85d6a0b61f2
 compiler/types/CoAxiom.hs | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/compiler/types/CoAxiom.hs b/compiler/types/CoAxiom.hs
index 36d9a67..9a85185 100644
--- a/compiler/types/CoAxiom.hs
+++ b/compiler/types/CoAxiom.hs
@@ -6,7 +6,7 @@
 -- and newtypes
 
 module CoAxiom (
-       Branched, Unbranched, BranchIndex, BranchList(..),
+       BranchFlag, Branched, Unbranched, BranchIndex, BranchList(..),
        toBranchList, fromBranchList,
        toBranchedList, toUnbranchedList,
        brListLength, brListNth, brListMap, brListFoldr, brListMapM,
@@ -124,6 +124,9 @@ type Branched = 'Branched
 deriving instance Typeable 'Branched
 type Unbranched = 'Unbranched
 deriving instance Typeable 'Unbranched
+-- By using type synonyms for the promoted constructors, we avoid needing
+-- DataKinds and the promotion quote in client modules. This also means that
+-- we don't need to export the term-level constructors, which should never be used.
 
 data BranchList a (br :: BranchFlag) where
   FirstBranch :: a -> BranchList a br



More information about the ghc-commits mailing list