diff options
author | Adam Chlipala <adamc@hcoop.net> | 2008-08-03 17:57:47 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2008-08-03 17:57:47 -0400 |
commit | 3e65e1558de55a1a47a62690b48159d92a4ed072 (patch) | |
tree | 57096304282d20c6a741d75fbeeedcbba1275a81 /src/mono_reduce.sml | |
parent | 289b94cdcffed0874ac10b38d69366d8a43057cf (diff) |
FFI datatypes
Diffstat (limited to 'src/mono_reduce.sml')
-rw-r--r-- | src/mono_reduce.sml | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/mono_reduce.sml b/src/mono_reduce.sml index 07634a57..20d26547 100644 --- a/src/mono_reduce.sml +++ b/src/mono_reduce.sml @@ -79,18 +79,30 @@ fun match (env, p : pat, e : exp) = else NONE - | (PCon (PConVar n1, NONE), ECon (n2, NONE)) => + | (PCon (PConVar n1, NONE), ECon (PConVar n2, NONE)) => if n1 = n2 then SOME env else NONE - | (PCon (PConVar n1, SOME p), ECon (n2, SOME e)) => + | (PCon (PConVar n1, SOME p), ECon (PConVar n2, SOME e)) => if n1 = n2 then match (env, p, e) else NONE + | (PCon (PConFfi {mod = m1, con = con1, ...}, NONE), ECon (PConFfi {mod = m2, con = con2, ...}, NONE)) => + if m1 = m2 andalso con1 = con2 then + SOME env + else + NONE + + | (PCon (PConFfi {mod = m1, con = con1, ...}, SOME ep), ECon (PConFfi {mod = m2, con = con2, ...}, SOME e)) => + if m1 = m2 andalso con1 = con2 then + match (env, p, e) + else + NONE + | (PRecord xps, ERecord xes) => let fun consider (xps, env) = |