summaryrefslogtreecommitdiff
path: root/src/reduce.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-02-21 15:33:20 -0500
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-02-21 15:33:20 -0500
commitc40cb1851bc27f0a0a99648be21dacb821b65ed9 (patch)
tree6ec268a6e7aaa927f41c76e354e78ca55585f69a /src/reduce.sml
parent9f20d9299eab7caab6421860b6a54f831af73921 (diff)
"Hello world" compiles, after replacing type-level fold with map
Diffstat (limited to 'src/reduce.sml')
-rw-r--r--src/reduce.sml13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/reduce.sml b/src/reduce.sml
index b428c01f..949b2a6d 100644
--- a/src/reduce.sml
+++ b/src/reduce.sml
@@ -103,14 +103,13 @@ fun conAndExp (namedC, namedE) =
CAbs (_, _, b) =>
con (KnownC c2 :: deKnown env) b
- | CApp ((CApp ((CFold _, _), f), _), i) =>
+ | CApp ((CMap (dom, ran), _), f) =>
(case #1 c2 of
- CRecord (_, []) => i
- | CRecord (k, (x, c) :: rest) =>
+ CRecord (_, []) => (CRecord (ran, []), loc)
+ | CRecord (_, (x, c) :: rest) =>
con (deKnown env)
- (CApp ((CApp ((CApp (f, x), loc), c), loc),
- (CApp (c1,
- (CRecord (k, rest), loc)), loc)), loc)
+ (CConcat ((CRecord (ran, [(x, (CApp (f, c), loc))]), loc),
+ (CApp (c1, (CRecord (dom, rest), loc)), loc)), loc)
| _ => (CApp (c1, c2), loc))
| _ => (CApp (c1, c2), loc)
@@ -130,7 +129,7 @@ fun conAndExp (namedC, namedE) =
(CRecord (k, xcs1 @ xcs2), loc)
| _ => (CConcat (c1, c2), loc)
end
- | CFold _ => all
+ | CMap _ => all
| CUnit => all