clarified signature;
authorwenzelm
Thu, 10 Feb 2022 19:31:07 +0100
changeset 75072 5299272be4c3
parent 75071 e93ebbb71c1f
child 75073 f8008b40b8a0
clarified signature;
src/Tools/Haskell/Haskell.thy
--- 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))