Skip to content

Commit

Permalink
fix deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
hanjoosten committed Jun 10, 2018
1 parent c382928 commit 6f8d2b8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ampersand.cabal
Expand Up @@ -54,7 +54,7 @@ library
lens == 4.16.*,
MissingH == 1.4.*,
mtl == 2.2.*,
pandoc == 2.1.*,
pandoc == 2.1.2,
pandoc-crossref == 0.3.1.0,
pandoc-types == 1.17.*,
parsec == 3.1.*,
Expand Down
12 changes: 6 additions & 6 deletions app/RegressionTest.hs
Expand Up @@ -11,7 +11,7 @@ import System.IO.Error (tryIOError)

main :: IO ExitCode
main = do
totalfails <- walk baseDir $$ myVisitor =$ sumarize
totalfails <- runConduit $ walk baseDir .| myVisitor .| sumarize
failWhenNotZero totalfails
where
baseDir = "." </> "testing"
Expand All @@ -26,7 +26,7 @@ main = do


-- Produces directory data
walk :: FilePath -> Source IO DirData
walk :: FilePath -> ConduitT () DirData IO ()
walk path = do
result <- lift $ tryIOError listdir
case result of
Expand Down Expand Up @@ -54,10 +54,10 @@ walk path = do
isHidden dir = head dir == '.'

-- Convert a DirData into an Int that contains the number of failed tests
myVisitor :: Conduit DirData IO Int
myVisitor :: ConduitT DirData Int IO ()
myVisitor = loop 1
where
loop :: Int -> Conduit DirData IO Int
loop :: Int -> ConduitT DirData Int IO ()
loop n =
awaitForever
(\dird -> do lift $ putStr $ ">> " ++ show n ++ ". "
Expand All @@ -67,10 +67,10 @@ myVisitor = loop 1
)


sumarize :: Sink Int IO Int
sumarize :: ConduitT Int Void IO Int
sumarize = loop 0
where
loop :: Int -> Sink Int IO Int
loop :: Int -> ConduitT Int Void IO Int
loop i =
await >>= maybe (return i)
(\x -> loop $! (i+x))
Expand Down

0 comments on commit 6f8d2b8

Please sign in to comment.