Mercurial > urweb
comparison src/lru_cache.sml @ 2258:b1ba35ce2613
Fix bug where pure caching didn't treat FFI applications as effectful.
author | Ziv Scully <ziv@mit.edu> |
---|---|
date | Sun, 27 Sep 2015 17:02:14 -0400 |
parents | c275bbc41194 |
children | 34ad83d9b729 |
comparison
equal
deleted
inserted
replaced
2257:28a541bd2d23 | 2258:b1ba35ce2613 |
---|---|
11 val stringTyp = (TFfi ("Basis", "string"), dummyLoc) | 11 val stringTyp = (TFfi ("Basis", "string"), dummyLoc) |
12 val optionStringTyp = (TOption stringTyp, dummyLoc) | 12 val optionStringTyp = (TOption stringTyp, dummyLoc) |
13 fun withTyp typ = map (fn exp => (exp, typ)) | 13 fun withTyp typ = map (fn exp => (exp, typ)) |
14 | 14 |
15 fun ffiAppCache' (func, index, argTyps) = | 15 fun ffiAppCache' (func, index, argTyps) = |
16 EFfiApp ("Sqlcache", func ^ Int.toString index, argTyps) | 16 let |
17 val m = "Sqlcache" | |
18 val f = func ^ Int.toString index | |
19 in | |
20 Settings.addEffectful (m, f); | |
21 EFfiApp (m, f, argTyps) | |
22 end | |
17 | 23 |
18 fun check (index, keys) = | 24 fun check (index, keys) = |
19 ffiAppCache' ("check", index, withTyp stringTyp keys) | 25 ffiAppCache' ("check", index, withTyp stringTyp keys) |
20 | 26 |
21 fun store (index, keys, value) = | 27 fun store (index, keys, value) = |