Last active
August 29, 2015 14:09
-
-
Save davidallsopp/9fbe3e883d2021390f03 to your computer and use it in GitHub Desktop.
Listing entries in a ZIP archive using zip-conduit in Haskell (https://hackage.haskell.org/package/zip-conduit-0.2.2.1/docs/Codec-Archive-Zip.html)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module ZipConduit1 where | |
| -- requires zip-conduit package | |
| -- slightly adapted from the docs at: | |
| -- https://hackage.haskell.org/package/zip-conduit-0.2.2.1/docs/Codec-Archive-Zip.html | |
| import Codec.Archive.Zip | |
| main :: IO () | |
| main = do | |
| names <- withArchive "test.zip" entryNames | |
| mapM_ putStrLn names | |
| -- or equivalently using >>= | |
| main2 :: IO () | |
| main2 = withArchive "test.zip" entryNames >>= mapM_ putStrLn | |
| -- or equivalently using =<< | |
| main3 :: IO () | |
| main3 = mapM_ putStrLn =<< withArchive "test.zip" entryNames |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment