--- a/src/Tools/Haskell/Haskell.thy Thu Feb 10 09:29:19 2022 +0100
+++ b/src/Tools/Haskell/Haskell.thy Thu Feb 10 19:31:07 2022 +0100
@@ -3890,15 +3890,15 @@
_ -> e
in (Map.insert x entry entries, _value entry))
-apply :: Ord k => T k v -> (k -> v) -> k -> IO v
-apply cache@(Cache ref) f x = do
+apply :: Ord k => T k v -> k -> IO v -> IO v
+apply cache@(Cache ref) x body = do
start <- Time.now
entries <- readIORef ref
case Map.lookup x entries of
Just entry -> do
commit cache x (entry {_access = start})
Nothing -> do
- y <- evaluate $ f x
+ y <- body
stop <- Time.now
commit cache x (Entry y start (stop - start))