hw-uri 0.2.0.0 → 0.2.0.1
raw patch · 2 files changed
+8/−4 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- hw-uri.cabal +1/−1
- src/HaskellWorks/Data/Uri/IO/Lazy.hs +7/−3
hw-uri.cabal view
@@ -1,7 +1,7 @@ cabal-version: 2.4 name: hw-uri-version: 0.2.0.0+version: 0.2.0.1 synopsis: Supports IO on URIs description: Supports IO on URIs. homepage: https://github.com/haskell-works/hw-uri
src/HaskellWorks/Data/Uri/IO/Lazy.hs view
@@ -78,10 +78,14 @@ readResource :: (MonadResource m, MonadCatch m) => AWS.Env -> Location -> m (Either UriError LBS.ByteString) readResource envAws = \case S3 s3Uri -> getS3Uri envAws s3Uri- Local path -> liftIO $ do- fileExists <- IO.doesFileExist path+ Local path -> do+ fileExists <- liftIO $ IO.doesFileExist path if fileExists- then Right <$> LBS.readFile path+ then do+ h <- liftIO $ IO.openFile path IO.ReadMode+ void $ register (IO.hClose h)+ lbs <- liftIO $ LBS.hGetContents h+ return (Right lbs) else pure (Left NotFound) HttpUri httpUri -> liftIO $ readHttpUri httpUri