ghcup-hs/3rdparty/zlib/examples/zpipe.hs
2020-05-10 13:12:39 +02:00

14 lines
388 B
Haskell

module Main where
import System.Environment
import qualified Data.ByteString.Lazy as B
import qualified Codec.Compression.Zlib as Zlib
main = do args <- getArgs
case args of
[] -> B.interact Zlib.compress
["-d"] -> B.interact Zlib.decompress
_ -> do name <- getProgName
error $ "usage: " ++ name ++ " [-d] < source > dest"