diff src/monoize.sml @ 288:4260ad920c36

Converting string to int
author Adam Chlipala <adamc@hcoop.net>
date Sun, 07 Sep 2008 11:33:13 -0400
parents ffe5b01908ae
children df00701f2323
line wrap: on
line diff
--- a/src/monoize.sml	Sun Sep 07 10:52:51 2008 -0400
+++ b/src/monoize.sml	Sun Sep 07 11:33:13 2008 -0400
@@ -80,6 +80,9 @@
                     (L'.TRecord (map (fn (x, t) => (monoName env x, mt env dtmap t)) xcs), loc)
                   | L.TRecord _ => poly ()
 
+                  | L.CApp ((L.CFfi ("Basis", "option"), _), t) =>
+                    (L'.TOption (mt env dtmap t), loc)
+
                   | L.CApp ((L.CFfi ("Basis", "show"), _), t) =>
                     (L'.TFun (mt env dtmap t, (L'.TFfi ("Basis", "string"), loc)), loc)
 
@@ -397,6 +400,8 @@
           | L.PVar (x, t) => (L'.PVar (x, monoType env t), loc)
           | L.PPrim p => (L'.PPrim p, loc)
           | L.PCon (dk, pc, [], po) => (L'.PCon (dk, monoPatCon env pc, Option.map (monoPat env) po), loc)
+          | L.PCon (L.Option, _, [t], NONE) => (L'.PNone (monoType env t), loc)
+          | L.PCon (L.Option, _, [t], SOME p) => (L'.PSome (monoType env t, monoPat env p), loc)
           | L.PCon _ => poly ()
           | L.PRecord xps => (L'.PRecord (map (fn (x, p, t) => (x, monoPat env p, monoType env t)) xps), loc)
     end