File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ library
6262 , pretty-show >= 1.6 && < 1.10
6363 , process >= 1.2 && < 1.7
6464 , QuickCheck >= 2.7 && < 2.13
65- , resourcet >= 1.1 && < 1.2
65+ , resourcet >= 1.1 && < 1.3
6666 , temporary-resourcet >= 0.1 && < 0.2
6767 , text >= 1.1 && < 1.3
6868 , transformers >= 0.4 && < 0.6
Original file line number Diff line number Diff line change 11{-# LANGUAGE OverloadedStrings #-}
2- {-# LANGUAGE TemplateHaskell #-}
2+
33module Test.Example.Resource where
44
55import Control.Monad.IO.Class (MonadIO (.. ))
6+ import Control.Monad.Morph (hoist )
67import Control.Monad.Trans.Except (ExceptT , throwE )
78import Control.Monad.Trans.Resource (runResourceT )
89
@@ -15,8 +16,8 @@ import System.FilePath ((</>))
1516import qualified System.IO.Temp as Temp
1617import System.Process
1718
18- data ProcessFailed =
19- ProcessFailed ! Int
19+ newtype ProcessFailed =
20+ ProcessFailed Int
2021 deriving (Show )
2122
2223unixSort :: MonadIO m => FilePath -> FilePath -> ExceptT ProcessFailed m ()
@@ -43,7 +44,7 @@ prop_unix_sort =
4344 Gen. list (Range. linear 0 100 ) $
4445 Gen. string (Range. constant 1 5 ) Gen. alpha
4546
46- test . runResourceT $ do
47+ test . hoist runResourceT $ do
4748 (_, dir) <- Temp. createTempDirectory Nothing " prop_dir"
4849
4950 let input = dir </> " input"
You can’t perform that action at this time.
0 commit comments