projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Improve External Core syntax for newtypes
[ghc-hetmet.git]
/
utils
/
ext-core
/
Core.hs
diff --git
a/utils/ext-core/Core.hs
b/utils/ext-core/Core.hs
index
66270cd
..
0fb48b8
100644
(file)
--- a/
utils/ext-core/Core.hs
+++ b/
utils/ext-core/Core.hs
@@
-9,14
+9,15
@@
data Module
data Tdef
= Data (Qual Tcon) [Tbind] [Cdef]
data Tdef
= Data (Qual Tcon) [Tbind] [Cdef]
- | Newtype (Qual Tcon) [Tbind] Axiom (Maybe Ty)
+ -- type constructor; coercion name; type arguments; type rep
+ -- If we have: (Newtype tc co tbs (Just t))
+ -- there is an implicit axiom:
+ -- co tbs :: tc tbs :=: t
+ | Newtype (Qual Tcon) (Qual Tcon) [Tbind] (Maybe Ty)
data Cdef
= Constr (Qual Dcon) [Tbind] [Ty]
data Cdef
= Constr (Qual Dcon) [Tbind] [Ty]
--- Newtype coercion
-type Axiom = (Qual Tcon, [Tbind], (Ty,Ty))
-
data Vdefg
= Rec [Vdef]
| Nonrec Vdef
data Vdefg
= Rec [Vdef]
| Nonrec Vdef