mirror of
https://github.com/sayo-hs/heftia.git
synced 2024-11-23 02:42:06 +03:00
[fix] Add display of each file size for clarity in NonDet example.
This commit is contained in:
parent
fcd9faf819
commit
758d5912c9
@ -259,7 +259,9 @@ totalFileSize path = do
|
||||
liftIO $ putStrLn $ "Found " <> path'
|
||||
|
||||
getFileSize path' >>= \case
|
||||
Right size -> pure $ Sum size
|
||||
Right size -> do
|
||||
liftIO $ putStrLn $ " ... " <> show size <> " bytes"
|
||||
pure $ Sum size
|
||||
Left NotAFile -> do
|
||||
totalFileSize path'
|
||||
|
||||
@ -299,11 +301,15 @@ runDummyFS root = interpret \case
|
||||
```
|
||||
>>> main
|
||||
Found ./README.md
|
||||
... 4000 bytes
|
||||
Found ./src
|
||||
Found ./src/Bar.hs
|
||||
... 1000 bytes
|
||||
Found ./src/Foo.hs
|
||||
... 2000 bytes
|
||||
Found ./test
|
||||
Found ./test/Baz.hs
|
||||
... 3000 bytes
|
||||
Sum {getSum = 10000}
|
||||
```
|
||||
|
||||
|
@ -61,7 +61,9 @@ totalFileSize path = do
|
||||
liftIO $ putStrLn $ "Found " <> path'
|
||||
|
||||
getFileSize path' >>= \case
|
||||
Right size -> pure $ Sum size
|
||||
Right size -> do
|
||||
liftIO $ putStrLn $ " ... " <> show size <> " bytes"
|
||||
pure $ Sum size
|
||||
Left NotAFile -> do
|
||||
totalFileSize path'
|
||||
|
||||
@ -77,11 +79,15 @@ main = runEff
|
||||
{-
|
||||
>>> main
|
||||
Found ./README.md
|
||||
... 4000 bytes
|
||||
Found ./src
|
||||
Found ./src/Bar.hs
|
||||
... 1000 bytes
|
||||
Found ./src/Foo.hs
|
||||
... 2000 bytes
|
||||
Found ./test
|
||||
Found ./test/Baz.hs
|
||||
... 3000 bytes
|
||||
Sum {getSum = 10000}
|
||||
-}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user