Mercurial > urweb
comparison src/monoize.sml @ 1848:e15234fbb163
Basis.tryRpc
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Tue, 16 Apr 2013 10:55:48 -0400 |
parents | c1e3805e604e |
children | 434921f54f54 |
comparison
equal
deleted
inserted
replaced
1847:8958b580d026 | 1848:e15234fbb163 |
---|---|
1 (* Copyright (c) 2008-2012, Adam Chlipala | 1 (* Copyright (c) 2008-2013, Adam Chlipala |
2 * All rights reserved. | 2 * All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are met: | 5 * modification, are permitted provided that the following conditions are met: |
6 * | 6 * |
4186 val (e2, fm) = monoExp (Env.pushERel env x t, st, fm) e2 | 4186 val (e2, fm) = monoExp (Env.pushERel env x t, st, fm) e2 |
4187 in | 4187 in |
4188 ((L'.ELet (x, t', e1, e2), loc), fm) | 4188 ((L'.ELet (x, t', e1, e2), loc), fm) |
4189 end | 4189 end |
4190 | 4190 |
4191 | L.EServerCall (n, es, t) => | 4191 | L.EServerCall (n, es, t, fmode) => |
4192 let | 4192 let |
4193 val t = monoType env t | 4193 val t = monoType env t |
4194 val (_, ft, _, name) = Env.lookupENamed env n | 4194 val (_, ft, _, name) = Env.lookupENamed env n |
4195 val (es, fm) = ListUtil.foldlMap (fn (e, fm) => monoExp (env, st, fm) e) fm es | 4195 val (es, fm) = ListUtil.foldlMap (fn (e, fm) => monoExp (env, st, fm) e) fm es |
4196 | 4196 |
4216 val eff = if IS.member (!readCookie, n) then | 4216 val eff = if IS.member (!readCookie, n) then |
4217 L'.ReadCookieWrite | 4217 L'.ReadCookieWrite |
4218 else | 4218 else |
4219 L'.ReadOnly | 4219 L'.ReadOnly |
4220 | 4220 |
4221 val e = (L'.EServerCall (call, t, eff), loc) | 4221 val e = (L'.EServerCall (call, t, eff, fmode), loc) |
4222 val e = liftExpInExp 0 e | 4222 val e = liftExpInExp 0 e |
4223 val e = (L'.EAbs ("_", unit, unit, e), loc) | 4223 val e = (L'.EAbs ("_", unit, unit, e), loc) |
4224 in | 4224 in |
4225 (e, fm) | 4225 (e, fm) |
4226 end | 4226 end |