Skip to content

Commit

Permalink
Add generalBracket for MonadMask instance on AWST' for 'exceptions' >…
Browse files Browse the repository at this point in the history
…= 0.10.0
  • Loading branch information
nhibberd authored and brendanhay committed Sep 21, 2018
1 parent c0bdafc commit fb91d38
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions amazonka/src/Control/Monad/Trans/AWS.hs
@@ -1,5 +1,6 @@
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
Expand Down Expand Up @@ -216,6 +217,15 @@ instance MonadMask m => MonadMask (AWST' r m) where
uninterruptibleMask a = AWST' $ uninterruptibleMask $ \u ->
unAWST $ a (AWST' . u . unAWST)

#if MIN_VERSION_exceptions(0,10,0)
generalBracket acquire rel action = AWST' $
generalBracket
(unAWST acquire)
(\a ex -> unAWST $ rel a ex)
(\a -> unAWST $ action a)
#endif


instance MonadBase b m => MonadBase b (AWST' r m) where
liftBase = liftBaseDefault

Expand Down

0 comments on commit fb91d38

Please sign in to comment.