Skip to content

Commit 961479e

Browse files
authored
Merge pull request #255 from endgame/resourcet-hoist
hedgehog-example: relax resourcet to < 1.3
2 parents fc98d47 + 060369f commit 961479e

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

hedgehog-example/hedgehog-example.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

hedgehog-example/src/Test/Example/Resource.hs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{-# LANGUAGE OverloadedStrings #-}
2-
{-# LANGUAGE TemplateHaskell #-}
2+
33
module Test.Example.Resource where
44

55
import Control.Monad.IO.Class (MonadIO(..))
6+
import Control.Monad.Morph (hoist)
67
import Control.Monad.Trans.Except (ExceptT, throwE)
78
import Control.Monad.Trans.Resource (runResourceT)
89

@@ -15,8 +16,8 @@ import System.FilePath ((</>))
1516
import qualified System.IO.Temp as Temp
1617
import System.Process
1718

18-
data ProcessFailed =
19-
ProcessFailed !Int
19+
newtype ProcessFailed =
20+
ProcessFailed Int
2021
deriving (Show)
2122

2223
unixSort :: 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"

0 commit comments

Comments
 (0)