summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-04-19 11:24:10 -0400
committerBen Gamari <ben@smart-cactus.org>2020-12-27 11:24:26 -0500
commitc92084b977947a34e09b6b6b79f6231d709fdf87 (patch)
tree899af222fce777fd3c6bb7457ff167a5e78e21b3
parent4fa045443cae84a9604bb107b531319c63228b33 (diff)
downloadhaskell-c92084b977947a34e09b6b6b79f6231d709fdf87.tar.gz
genprimopcode: Add a second levity-polymorphic tyvar
This will be needed shortly. (cherry picked from commit ef42c578f2c4fa48d9e191592c8442653ee1ea9a)
-rw-r--r--utils/genprimopcode/Main.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/utils/genprimopcode/Main.hs b/utils/genprimopcode/Main.hs
index 3fe744fec3..e549abf3cf 100644
--- a/utils/genprimopcode/Main.hs
+++ b/utils/genprimopcode/Main.hs
@@ -505,6 +505,7 @@ gen_latex_doc (Info defaults entries)
tvars = tvars_of typ
tbinds [] = ". "
tbinds ("o":tbs) = "(o::?) " ++ (tbinds tbs)
+ tbinds ("p":tbs) = "(p::?) " ++ (tbinds tbs)
tbinds (tv:tbs) = tv ++ " " ++ (tbinds tbs)
tvars_of (TyF t1 t2) = tvars_of t1 `union` tvars_of t2
tvars_of (TyC t1 t2) = tvars_of t1 `union` tvars_of t2
@@ -864,6 +865,7 @@ ppTyVar "b" = "betaTyVar"
ppTyVar "c" = "gammaTyVar"
ppTyVar "s" = "deltaTyVar"
ppTyVar "o" = "runtimeRep1TyVar, openAlphaTyVar"
+ppTyVar "p" = "runtimeRep2TyVar, openBetaTyVar"
ppTyVar _ = error "Unknown type var"
ppType :: Ty -> String
@@ -897,6 +899,7 @@ ppType (TyVar "b") = "betaTy"
ppType (TyVar "c") = "gammaTy"
ppType (TyVar "s") = "deltaTy"
ppType (TyVar "o") = "openAlphaTy"
+ppType (TyVar "p") = "openBetaTy"
ppType (TyApp (TyCon "State#") [x]) = "mkStatePrimTy " ++ ppType x
ppType (TyApp (TyCon "MutVar#") [x,y]) = "mkMutVarPrimTy " ++ ppType x