aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/mono_reduce.sml
diff options
context:
space:
mode:
Diffstat (limited to 'src/mono_reduce.sml')
-rw-r--r--src/mono_reduce.sml14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mono_reduce.sml b/src/mono_reduce.sml
index 50553560..591d4c1b 100644
--- a/src/mono_reduce.sml
+++ b/src/mono_reduce.sml
@@ -208,6 +208,20 @@ fun match (env, p : pat, e : exp) =
else
No
+ | (PPrim (Prim.String (_, s)), _) =>
+ let
+ fun lengthLb (e : exp) =
+ case #1 e of
+ EStrcat (e1, e2) => lengthLb e1 + lengthLb e2
+ | EPrim (Prim.String (_, s)) => size s
+ | _ => 0
+ in
+ if lengthLb e > size s then
+ No
+ else
+ Maybe
+ end
+
| (PCon (_, PConVar n1, po), ECon (_, PConVar n2, eo)) =>
if n1 = n2 then
case (po, eo) of