summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-05-28 10:35:25 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-05-28 10:35:25 -0400
commit6a6c98d74f0eb61b52e8adc5385698a224eeccc1 (patch)
treebc9e633b76c75ea47d6cfdb826c549ed7cd4c66a /src
parent3cb644caeed50e5c82778b5ed7c165950655109a (diff)
Demo compiles with pattern-matching-fu
Diffstat (limited to 'src')
-rw-r--r--src/monoize.sml2
-rw-r--r--src/reduce.sml3
-rw-r--r--src/urweb.grm2
3 files changed, 7 insertions, 0 deletions
diff --git a/src/monoize.sml b/src/monoize.sml
index 87c4d86c..4d7a666e 100644
--- a/src/monoize.sml
+++ b/src/monoize.sml
@@ -148,6 +148,8 @@ fun monoType env =
(L'.TFfi ("Basis", "string"), loc)
| L.CApp ((L.CApp ((L.CFfi ("Basis", "sql_table"), _), _), _), _) =>
(L'.TFfi ("Basis", "string"), loc)
+ | L.CApp ((L.CFfi ("Basis", "sql_view"), _), _) =>
+ (L'.TFfi ("Basis", "string"), loc)
| L.CFfi ("Basis", "sql_sequence") =>
(L'.TFfi ("Basis", "string"), loc)
| L.CApp ((L.CApp ((L.CFfi ("Basis", "sql_query"), _), _), _), _) =>
diff --git a/src/reduce.sml b/src/reduce.sml
index 9460d3fe..a6c0b38a 100644
--- a/src/reduce.sml
+++ b/src/reduce.sml
@@ -390,6 +390,9 @@ fun kindConAndExp (namedC, namedE) =
| _ => default ()
end
+ | ECase (_, [((PRecord [], _), e)], _) => exp env e
+ | ECase (_, [((PWild, _), e)], _) => exp env e
+
| ECase (e, pes, {disc, result}) =>
let
fun patBinds (p, _) =
diff --git a/src/urweb.grm b/src/urweb.grm
index 638ede12..0d2c1d47 100644
--- a/src/urweb.grm
+++ b/src/urweb.grm
@@ -985,6 +985,7 @@ earg : patS (fn (e, t) =>
val e' = case #1 patS of
PVar x => (EAbs (x, NONE, e), loc)
+ | PAnnot ((PVar x, _), t) => (EAbs (x, SOME t, e), loc)
| _ => (EAbs ("$x", SOME pt,
(ECase ((EVar ([], "$x", DontInfer),
loc),
@@ -1001,6 +1002,7 @@ eargp : pterm (fn (e, t) =>
val e' = case #1 pterm of
PVar x => (EAbs (x, NONE, e), loc)
+ | PAnnot ((PVar x, _), t) => (EAbs (x, SOME t, e), loc)
| _ => (EAbs ("$x", SOME pt,
(ECase ((EVar ([], "$x", DontInfer),
loc),