Mercurial > urweb
comparison src/mono_reduce.sml @ 280:fdd7a698be01
Compiling a parametrized query the inefficient way
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Tue, 02 Sep 2008 17:31:45 -0400 |
parents | bacd0ba869e1 |
children | c0e4ac23522d |
comparison
equal
deleted
inserted
replaced
279:8bb46d87b074 | 280:fdd7a698be01 |
---|---|
95 fun match (env, p : pat, e : exp) = | 95 fun match (env, p : pat, e : exp) = |
96 case (#1 p, #1 e) of | 96 case (#1 p, #1 e) of |
97 (PWild, _) => Yes env | 97 (PWild, _) => Yes env |
98 | (PVar (x, t), _) => Yes (E.pushERel env x t (SOME e)) | 98 | (PVar (x, t), _) => Yes (E.pushERel env x t (SOME e)) |
99 | 99 |
100 | (PPrim (Prim.String s), EStrcat ((EPrim (Prim.String s'), _), _)) => | |
101 if String.isPrefix s' s then | |
102 Maybe | |
103 else | |
104 No | |
105 | |
100 | (PPrim p, EPrim p') => | 106 | (PPrim p, EPrim p') => |
101 if Prim.equal (p, p') then | 107 if Prim.equal (p, p') then |
102 Yes env | 108 Yes env |
103 else | 109 else |
104 No | 110 No |