Skip to content

Commit

Permalink
Merge pull request #186 from endgame/monadfail
Browse files Browse the repository at this point in the history
MonadFail support
  • Loading branch information
gregwebs committed Jun 27, 2019
2 parents ba71d21 + 5093c26 commit 1b6643a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions shelly.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ Test-Suite shelly-testsuite
enclosed-exceptions,
exceptions

if impl(ghc < 8.0)
build-depends: fail >= 4.9 && < 4.10

extensions:
CPP

Expand Down
3 changes: 2 additions & 1 deletion src/Shelly/Base.hs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import System.IO ( Handle, hFlush, stderr, stdout )
import Control.Monad (when, (>=>),
liftM
)
import Control.Monad.Fail (MonadFail)
import Control.Monad.Base
import Control.Monad.Trans.Control
import Control.Applicative (Applicative, (<$>))
Expand Down Expand Up @@ -71,7 +72,7 @@ type ShIO a = Sh a

newtype Sh a = Sh {
unSh :: ReaderT (IORef State) IO a
} deriving (Applicative, Monad, MonadIO, MonadReader (IORef State), Functor, Catch.MonadMask)
} deriving (Applicative, Monad, MonadFail, MonadIO, MonadReader (IORef State), Functor, Catch.MonadMask)

instance MonadBase IO Sh where
liftBase = Sh . ReaderT . const
Expand Down

0 comments on commit 1b6643a

Please sign in to comment.