# HG changeset patch # User wenzelm # Date 1644517867 -3600 # Node ID 5299272be4c361af59ed7126fbbad42fd493cebe # Parent e93ebbb71c1f2fab64bbd3ff4f7df7ae671d2776 clarified signature; diff -r e93ebbb71c1f -r 5299272be4c3 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))