Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: JackKelly-Bellroy <[email protected]>
  • Loading branch information
Tristano8 and JackKelly-Bellroy authored Sep 19, 2023
1 parent ff58626 commit d07abed
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Control/Concurrent/CachedIO.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion test/test-cachedIO.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d07abed

Please sign in to comment.