From d7b951b388b36ee5764c24b7afd3fd277ddb1ccf Mon Sep 17 00:00:00 2001 From: Justin Bedo Date: Fri, 4 Aug 2023 09:54:35 +1000 Subject: prefer speed to compression --- Data/FastQ.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Data/FastQ.hs b/Data/FastQ.hs index 850ac5c..8309c97 100644 --- a/Data/FastQ.hs +++ b/Data/FastQ.hs @@ -63,7 +63,7 @@ parse l r = unparse :: FilePath -> FilePath -> Stream IO ReadPair -> IO () unparse l r str = do - (compress -> left, compress -> right) <- fmap unparse' str & toLazyBS + (compress' -> left, compress' -> right) <- fmap unparse' str & toLazyBS lh <- openFile l WriteMode rh <- openFile r WriteMode writeFiles lh rh left right @@ -84,3 +84,5 @@ unparse l r str = do toLazyBS :: Stream IO (ByteString, ByteString) -> IO (BSL.ByteString, BSL.ByteString) toLazyBS = S.foldrM (\(l, r) b -> bimap (BSL.chunk ("@" <> l)) (BSL.chunk ("@" <> r)) <$> unsafeInterleaveIO b) (pure (BSL.Empty, BSL.Empty)) + + compress' = compressWith (defaultCompressParams {compressLevel = bestSpeed}) -- cgit v1.2.3