Skip to content

Commit

Permalink
Merge branch 'develop' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
vst committed Mar 31, 2021
2 parents 15a71d4 + 509db58 commit 8bdd29b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
10 changes: 5 additions & 5 deletions comprex.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ cabal-version: 1.12
--
-- see: https://github.com/sol/hpack
--
-- hash: 66f8256d394afb12b209e45ebc4b418147ab46fe0844ebdbfcda8121f3efcd24
-- hash: 321fef7312ab94928bd16fa38989d2b1c3010ec41e71e0a6b6bc704c0d5d7c06

name: comprex
version: 0.0.0.0
version: 0.0.0.1
description: Please see the README on GitHub at <https://github.com/telostat/comprex#readme>
homepage: https://github.com/vst/comprex#readme
bug-reports: https://github.com/vst/comprex/issues
homepage: https://github.com/telostat/comprex#readme
bug-reports: https://github.com/telostat/comprex/issues
author: Vehbi Sinan Tunalioglu
maintainer: [email protected]
copyright: Copyright (c) 2021 Telostat Pte Ltd
Expand All @@ -23,7 +23,7 @@ extra-source-files:

source-repository head
type: git
location: https://github.com/vst/comprex
location: https://github.com/telostat/comprex

flag static
description: Use static linking for the main executable
Expand Down
4 changes: 2 additions & 2 deletions package.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: comprex
version: 0.0.0.0
github: "vst/comprex"
version: 0.0.0.1
github: "telostat/comprex"
license: MIT
author: "Vehbi Sinan Tunalioglu"
maintainer: "[email protected]"
Expand Down
5 changes: 3 additions & 2 deletions src/System/Comprex.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
module System.Comprex where

import qualified Codec.Compression.GZip as GZ
import Control.Monad ((>=>))
import Control.Monad.Catch (MonadThrow)
import Control.Monad.IO.Class (MonadIO(liftIO))
import qualified Crypto.Hash.SHA1 as SHA1
Expand All @@ -21,11 +22,11 @@ import Text.Printf (printf)
programAnalyze :: (MonadThrow m, MonadIO m) => Directory -> m ()
programAnalyze d = do
filePairs <- catMaybes <$> (mapM getCompressedFilePair =<< listFilesUncompressed d)
hashes <- mapM computeHashes filePairs
liftIO $ putStrLn "FileA,HashA,FileB,HashB,Match"
mapM_ printPair hashes
mapM_ computeAndPrintHashes filePairs
where
printPair ((u, hu), (c, hc)) = liftIO . putStrLn $ printf "%s,%s,%s,%s,%s" (show u) (show hu) (show c) (show hc) (show $ hu == hc)
computeAndPrintHashes = computeHashes >=> printPair


-- | Cleanup program.
Expand Down

0 comments on commit 8bdd29b

Please sign in to comment.