# HG changeset patch # User Adam Chlipala # Date 1217804476 14400 # Node ID fb6ed259f5bd946492d60916bfac156d8b239370 # Parent 88d46972de5389abd3aa56a269d91b317804f73f Mono_opt for urlifying bools diff -r 88d46972de53 -r fb6ed259f5bd src/mono_opt.sml --- a/src/mono_opt.sml Sun Aug 03 18:53:20 2008 -0400 +++ b/src/mono_opt.sml Sun Aug 03 19:01:16 2008 -0400 @@ -185,6 +185,17 @@ | EWrite (EFfiApp ("Basis", "urlifyString", [e]), _) => EFfiApp ("Basis", "urlifyString_w", [e]) + | EFfiApp ("Basis", "urlifyBool", [(ECon (PConFfi {con = "True", ...}, NONE), _)]) => + EPrim (Prim.String "1") + | EFfiApp ("Basis", "urlifyBool", [(ECon (PConFfi {con = "False", ...}, NONE), _)]) => + EPrim (Prim.String "0") + | EWrite (EFfiApp ("Basis", "urlifyBool", [(ECon (PConFfi {con = "True", ...}, NONE), _)]), loc) => + EWrite (EPrim (Prim.String "1"), loc) + | EWrite (EFfiApp ("Basis", "urlifyBool", [(ECon (PConFfi {con = "False", ...}, NONE), _)]), loc) => + EWrite (EPrim (Prim.String "0"), loc) + | EWrite (EFfiApp ("Basis", "urlifyBool", [e]), _) => + EFfiApp ("Basis", "urlifyBool_w", [e]) + | EWrite (ECase (discE, pes, {disc, ...}), loc) => optExp (ECase (discE, map (fn (p, e) => (p, (EWrite e, loc))) pes,