Skip to content

Commit

Permalink
Merge branch 'master' of github.com:pepeiborra/control-monad-exception
Browse files Browse the repository at this point in the history
  • Loading branch information
pepeiborra committed Mar 4, 2012
2 parents 16467d4 + 8a68bc3 commit 737c357
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Control/Monad/Exception.hs
@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}

{-|
A Monad Transformer for explicitly typed checked exceptions, described in detail by:
Expand Down Expand Up @@ -74,8 +75,11 @@ module Control.Monad.Exception (

-- * Reexports
Exception(..), SomeException(..), Typeable(..),
Failure(..),
#if !MIN_VERSION_failure(0,2,0)
Try(..), NothingException(..),
Failure(..), WrapFailure(..),
WrapFailure(..),
#endif
MonadLoc(..), withLocTH
) where

Expand Down
3 changes: 3 additions & 0 deletions Control/Monad/Exception/Base.hs
@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE FlexibleContexts, FlexibleInstances, TypeSynonymInstances #-}
Expand Down Expand Up @@ -111,6 +112,7 @@ instance Monad m => Applicative (EMT l m) where
instance (Exception e, Throws e l, Monad m) => Failure e (EMT l m) where
failure = throw

#if !MIN_VERSION_failure(0,2,0)
instance (Exception e, Throws e l, Failure e m, Monad m) => WrapFailure e (EMT l m) where
wrapFailure mkE m
= EMT $ do
Expand All @@ -119,6 +121,7 @@ instance (Exception e, Throws e l, Failure e m, Monad m) => WrapFailure e (EMT l
Right _ -> return v
Left (loc, CheckedException (SomeException e))
-> return $ Left (loc, CheckedException $ toException $ mkE e)
#endif

instance MonadTrans (EMT l) where
lift = EMT . liftM Right
Expand Down
2 changes: 1 addition & 1 deletion control-monad-exception.cabal
Expand Up @@ -79,7 +79,7 @@ Flag extensibleExceptions

Library
buildable: True
build-depends: failure >= 0.1 && < 0.2
build-depends: failure >= 0.1 && < 0.3
, transformers
, monadloc

Expand Down

0 comments on commit 737c357

Please sign in to comment.