diff src/monoize.sml @ 777:87a7702d681d

outer demo
author Adam Chlipala <adamc@hcoop.net>
date Sun, 03 May 2009 14:57:33 -0400
parents a8bdd5a0d9b0
children 2c463eee89fa
line wrap: on
line diff
--- a/src/monoize.sml	Sun May 03 12:49:47 2009 -0400
+++ b/src/monoize.sml	Sun May 03 14:57:33 2009 -0400
@@ -1036,6 +1036,20 @@
                 ((L'.EAbs ("f", readType (t, loc), readErrType (t, loc),
                            (L'.EField ((L'.ERel 0, loc), "ReadError"), loc)), loc), fm)
             end
+          | L.ECApp ((L.EFfi ("Basis", "mkRead"), _), t) =>
+            let
+                val t = monoType env t
+                val b = (L'.TFfi ("Basis", "string"), loc)
+                val b' = (L'.TOption b, loc)
+                val dom = (L'.TFun (t, b), loc)
+                val dom' = (L'.TFun (t, b'), loc)
+            in
+                ((L'.EAbs ("f", dom, (L'.TFun (dom', readType (t, loc)), loc),
+                           (L'.EAbs ("f'", dom', readType (t, loc),
+                                     (L'.ERecord [("Read", (L'.ERel 0, loc), dom),
+                                                  ("ReadError", (L'.ERel 1, loc), dom')], loc)), loc)), loc),
+                 fm)
+            end
           | L.EFfi ("Basis", "read_int") =>
             let
                 val t = (L'.TFfi ("Basis", "int"), loc)