summaryrefslogtreecommitdiff
path: root/src/expl_print.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-06-19 17:11:24 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-06-19 17:11:24 -0400
commit6924bb5d394ee9cbdf7dbf376c45a4ee04383c5c (patch)
tree537dd4799d78f6bed5ccac263825fad39f0b5747 /src/expl_print.sml
parent03ecfc6bbbff1492662930a708a1e9be685ef023 (diff)
Explifying functors
Diffstat (limited to 'src/expl_print.sml')
-rw-r--r--src/expl_print.sml50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/expl_print.sml b/src/expl_print.sml
index 4841f0c7..0e7f66eb 100644
--- a/src/expl_print.sml
+++ b/src/expl_print.sml
@@ -293,6 +293,30 @@ and p_sgn env (sgn, _) =
newline,
string "end"]
| SgnVar n => string (#1 (E.lookupSgnNamed env n))
+ | SgnFun (x, n, sgn, sgn') => box [string "functor",
+ space,
+ string "(",
+ string x,
+ space,
+ string ":",
+ space,
+ p_sgn env sgn,
+ string ")",
+ space,
+ string ":",
+ space,
+ p_sgn (E.pushStrNamed env x n sgn) sgn']
+ | SgnWhere (sgn, x, c) => box [p_sgn env sgn,
+ space,
+ string "where",
+ space,
+ string "con",
+ space,
+ string x,
+ space,
+ string "=",
+ space,
+ p_con env c]
fun p_decl env ((d, _) : decl) =
case d of
@@ -349,6 +373,32 @@ and p_str env (str, _) =
| StrProj (str, s) => box [p_str env str,
string ".",
string s]
+ | StrFun (x, n, sgn, sgn', str) =>
+ let
+ val env' = E.pushStrNamed env x n sgn
+ in
+ box [string "functor",
+ space,
+ string "(",
+ string x,
+ space,
+ string ":",
+ space,
+ p_sgn env sgn,
+ string ")",
+ space,
+ string ":",
+ space,
+ p_sgn env' sgn',
+ space,
+ string "=>",
+ space,
+ p_str env' str]
+ end
+ | StrApp (str1, str2) => box [p_str env str1,
+ string "(",
+ p_str env str2,
+ string ")"]
and p_file env file =
let