From d07abed08a91ba0b67a973e95eb028917177e031 Mon Sep 17 00:00:00 2001 From: Hugh Davidson <32408698+Tristano8@users.noreply.github.com> Date: Tue, 19 Sep 2023 17:28:36 +1000 Subject: [PATCH] Apply suggestions from code review Co-authored-by: JackKelly-Bellroy <64521034+JackKelly-Bellroy@users.noreply.github.com> --- src/Control/Concurrent/CachedIO.hs | 2 +- test/test-cachedIO.hs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Control/Concurrent/CachedIO.hs b/src/Control/Concurrent/CachedIO.hs index f1a2bea..1d12899 100644 --- a/src/Control/Concurrent/CachedIO.hs +++ b/src/Control/Concurrent/CachedIO.hs @@ -30,7 +30,7 @@ import Data.Time.Clock (NominalDiffTime, addUTCTime, getCurrentTime, UTCTime) -- | A cached IO action in some monad @m@. Use 'runCached' to extract the action when you want to query it. -- -- This newtype is intended to make it harder to accidentally 'Control.Monad.join' (and defeat all caching) when the fetch action and the outer monad are the same. -newtype Cached t a = Cached {runCached :: t a} +newtype Cached m a = Cached {runCached :: m a} data State a = Uninitialized | Initializing | Updating a | Fresh UTCTime a diff --git a/test/test-cachedIO.hs b/test/test-cachedIO.hs index f1de6e4..d5cbab3 100644 --- a/test/test-cachedIO.hs +++ b/test/test-cachedIO.hs @@ -16,7 +16,7 @@ crawlTheInternet = do searchEngine :: String -> Cached IO [String] -> IO [String] searchEngine query internet = do pages <- runCached internet - return $ filter ( query `isInfixOf`) pages + return $ filter (query `isInfixOf`) pages main :: IO () main = do