packages feed

lz4-hs-0.1.0.0: mem/Mem.hs

module Main (main) where

import           Codec.Lz4
import qualified Data.ByteString.Lazy as BSL
import           System.FilePath      ((</>))
import           System.IO.Temp       (withSystemTempDirectory)


main :: IO ()
main = sequence_
    [ compressDump
    , decompressDump
    ]

decompressDump :: IO ()
decompressDump = withSystemTempDirectory "lz4" $
    \fp -> BSL.writeFile (fp </> "valgrind-3.15.0.tar") =<<
        (decompress <$> BSL.readFile "valgrind-3.15.0.tar.lz4")

compressDump :: IO ()
compressDump = withSystemTempDirectory "lz4" $
    \fp -> BSL.writeFile (fp </> "valgrind-3.15.0.tar.lz4") =<<
        (compress <$> BSL.readFile "valgrind-3.15.0.tar")