Mercurial > urweb
comparison src/mono_opt.sml @ 905:7a4b026e45dd
Library improvements; proper list [un]urlification; remove server-side ServerCalls; eta reduction in type inference
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sun, 09 Aug 2009 16:13:27 -0400 |
parents | dae141d911d9 |
children | 8e540df3294d |
comparison
equal
deleted
inserted
replaced
904:6d9538ce94d8 | 905:7a4b026e45dd |
---|---|
28 structure MonoOpt :> MONO_OPT = struct | 28 structure MonoOpt :> MONO_OPT = struct |
29 | 29 |
30 open Mono | 30 open Mono |
31 structure U = MonoUtil | 31 structure U = MonoUtil |
32 | 32 |
33 val removeServerCalls = ref false | |
34 | |
33 fun typ t = t | 35 fun typ t = t |
34 fun decl d = d | 36 fun decl d = d |
35 | 37 |
36 fun attrifyInt n = | 38 fun attrifyInt n = |
37 if n < 0 then | 39 if n < 0 then |
478 (case rev es of | 480 (case rev es of |
479 (e as (_, loc)) :: es => #1 (foldl (fn (e, es) => (EStrcat (e, es), loc)) e es) | 481 (e as (_, loc)) :: es => #1 (foldl (fn (e, es) => (EStrcat (e, es), loc)) e es) |
480 | [] => raise Fail "MonoOpt impossible nil") | 482 | [] => raise Fail "MonoOpt impossible nil") |
481 | NONE => e | 483 | NONE => e |
482 end | 484 end |
485 | |
486 | EServerCall (_, _, _, _, ue) => | |
487 if !removeServerCalls then | |
488 optExp ue | |
489 else | |
490 e | |
483 | 491 |
484 | _ => e | 492 | _ => e |
485 | 493 |
486 and optExp e = #1 (U.Exp.map {typ = typ, exp = exp} e) | 494 and optExp e = #1 (U.Exp.map {typ = typ, exp = exp} e) |
487 | 495 |