ghcup-hs/3rdparty/zlib/examples/zpipe.hs

14 lines
388 B
Haskell
Raw Normal View History

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"