{-# LANGUAGE CPP #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
#ifdef TRUSTWORTHY
{-# LANGUAGE Trustworthy #-}
#endif
#if __GLASGOW_HASKELL__ >= 710
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ViewPatterns #-}
#endif
#include "lens-common.h"
#if !(MIN_VERSION_exceptions(0,4,0))
#define MonadThrow MonadCatch
#endif
module Control.Exception.Lens
(
catching, catching_
, handling, handling_
, trying, trying_
, throwing
, throwing_
, throwingM
, throwingTo
, mappedException, mappedException'
, exception
#if __GLASGOW_HASKELL__ >= 710
, pattern Exception
#endif
, Handleable(..)
, AsIOException(..)
#if __GLASGOW_HASKELL__ >= 710
, pattern IOException_
#endif
, AsArithException(..)
, _Overflow, _Underflow, _LossOfPrecision, _DivideByZero, _Denormal
, _RatioZeroDenominator
#if __GLASGOW_HASKELL__ >= 710
, pattern ArithException_
, pattern Overflow_
, pattern Underflow_
, pattern LossOfPrecision_
, pattern DivideByZero_
, pattern Denormal_
, pattern RatioZeroDenominator_
#endif
, AsArrayException(..)
, _IndexOutOfBounds
, _UndefinedElement
#if __GLASGOW_HASKELL__ >= 710
, pattern ArrayException_
, pattern IndexOutOfBounds_
, pattern UndefinedElement_
#endif
, AsAssertionFailed(..)
#if __GLASGOW_HASKELL__ >= 710
, pattern AssertionFailed__
, pattern AssertionFailed_
#endif
, AsAsyncException(..)
, _StackOverflow
, _HeapOverflow
, _ThreadKilled
, _UserInterrupt
#if __GLASGOW_HASKELL__ >= 710
, pattern AsyncException_
, pattern StackOverflow_
, pattern HeapOverflow_
, pattern ThreadKilled_
, pattern UserInterrupt_
#endif
, AsNonTermination(..)
#if __GLASGOW_HASKELL__ >= 710
, pattern NonTermination__
, pattern NonTermination_
#endif
, AsNestedAtomically(..)
#if __GLASGOW_HASKELL__ >= 710
, pattern NestedAtomically__
, pattern NestedAtomically_
#endif
, AsBlockedIndefinitelyOnMVar(..)
#if __GLASGOW_HASKELL__ >= 710
, pattern BlockedIndefinitelyOnMVar__
, pattern BlockedIndefinitelyOnMVar_
#endif
, AsBlockedIndefinitelyOnSTM(..)
#if __GLASGOW_HASKELL__ >= 710
, pattern BlockedIndefinitelyOnSTM__
, pattern BlockedIndefinitelyOnSTM_
#endif
, AsDeadlock(..)
#if __GLASGOW_HASKELL__ >= 710
, pattern Deadlock__
, pattern Deadlock_
#endif
, AsNoMethodError(..)
#if __GLASGOW_HASKELL__ >= 710
, pattern NoMethodError__
, pattern NoMethodError_
#endif
, AsPatternMatchFail(..)
#if __GLASGOW_HASKELL__ >= 710
, pattern PatternMatchFail__
, pattern PatternMatchFail_
#endif
, AsRecConError(..)
, AsRecSelError(..)
, AsRecUpdError(..)
#if __GLASGOW_HASKELL__ >= 710
, pattern RecConError__
, pattern RecConError_
, pattern RecSelError__
, pattern RecSelError_
, pattern RecUpdError__
, pattern RecUpdError_
#endif
, AsErrorCall(..)
#if __GLASGOW_HASKELL__ >= 710
, pattern ErrorCall__
, pattern ErrorCall_
#endif
#if MIN_VERSION_base(4,8,0)
, AsAllocationLimitExceeded(..)
, pattern AllocationLimitExceeded__
, pattern AllocationLimitExceeded_
#endif
#if MIN_VERSION_base(4,9,0)
, AsTypeError(..)
, pattern TypeError__
, pattern TypeError_
#endif
#if MIN_VERSION_base(4,10,0)
, AsCompactionFailed(..)
, pattern CompactionFailed__
, pattern CompactionFailed_
#endif
, AsHandlingException(..)
#if __GLASGOW_HASKELL__ >= 710
, pattern HandlingException__
, pattern HandlingException_
#endif
) where
import Control.Applicative
import Control.Monad
import Control.Monad.IO.Class
import Control.Monad.Catch as Catch
import Control.Exception as Exception hiding (try, tryJust, catchJust)
import Control.Lens
import Control.Lens.Internal.Exception
import Data.Monoid
import GHC.Conc (ThreadId)
import Prelude
( const, either, flip, id
, (.)
, Maybe(..), Either(..), String
#if __GLASGOW_HASKELL__ >= 710
, Bool(..)
#endif
)
exception :: Exception a => Prism' SomeException a
exception :: Prism' SomeException a
exception = (a -> SomeException)
-> (SomeException -> Maybe a) -> Prism' SomeException a
forall b s a. (b -> s) -> (s -> Maybe a) -> Prism s s a b
prism' a -> SomeException
forall e. Exception e => e -> SomeException
toException SomeException -> Maybe a
forall e. Exception e => SomeException -> Maybe e
fromException
{-# INLINE exception #-}
#if __GLASGOW_HASKELL__ >= 710
pattern $bException :: a -> SomeException
$mException :: forall r a.
Exception a =>
SomeException -> (a -> r) -> (Void# -> r) -> r
Exception e <- (preview exception -> Just e) where
Exception a
e = AReview SomeException a -> a -> SomeException
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview SomeException a
forall a. Exception a => Prism' SomeException a
exception a
e
#endif
catching :: MonadCatch m => Getting (First a) SomeException a -> m r -> (a -> m r) -> m r
catching :: Getting (First a) SomeException a -> m r -> (a -> m r) -> m r
catching Getting (First a) SomeException a
l = (SomeException -> Maybe a) -> m r -> (a -> m r) -> m r
forall (m :: * -> *) e b a.
(MonadCatch m, Exception e) =>
(e -> Maybe b) -> m a -> (b -> m a) -> m a
catchJust (Getting (First a) SomeException a -> SomeException -> Maybe a
forall s (m :: * -> *) a.
MonadReader s m =>
Getting (First a) s a -> m (Maybe a)
preview Getting (First a) SomeException a
l)
{-# INLINE catching #-}
catching_ :: MonadCatch m => Getting (First a) SomeException a -> m r -> m r -> m r
catching_ :: Getting (First a) SomeException a -> m r -> m r -> m r
catching_ Getting (First a) SomeException a
l m r
a m r
b = (SomeException -> Maybe a) -> m r -> (a -> m r) -> m r
forall (m :: * -> *) e b a.
(MonadCatch m, Exception e) =>
(e -> Maybe b) -> m a -> (b -> m a) -> m a
catchJust (Getting (First a) SomeException a -> SomeException -> Maybe a
forall s (m :: * -> *) a.
MonadReader s m =>
Getting (First a) s a -> m (Maybe a)
preview Getting (First a) SomeException a
l) m r
a (m r -> a -> m r
forall a b. a -> b -> a
const m r
b)
{-# INLINE catching_ #-}
handling :: MonadCatch m => Getting (First a) SomeException a -> (a -> m r) -> m r -> m r
handling :: Getting (First a) SomeException a -> (a -> m r) -> m r -> m r
handling Getting (First a) SomeException a
l = (m r -> (a -> m r) -> m r) -> (a -> m r) -> m r -> m r
forall a b c. (a -> b -> c) -> b -> a -> c
flip (Getting (First a) SomeException a -> m r -> (a -> m r) -> m r
forall (m :: * -> *) a r.
MonadCatch m =>
Getting (First a) SomeException a -> m r -> (a -> m r) -> m r
catching Getting (First a) SomeException a
l)
{-# INLINE handling #-}
handling_ :: MonadCatch m => Getting (First a) SomeException a -> m r -> m r -> m r
handling_ :: Getting (First a) SomeException a -> m r -> m r -> m r
handling_ Getting (First a) SomeException a
l = (m r -> m r -> m r) -> m r -> m r -> m r
forall a b c. (a -> b -> c) -> b -> a -> c
flip (Getting (First a) SomeException a -> m r -> m r -> m r
forall (m :: * -> *) a r.
MonadCatch m =>
Getting (First a) SomeException a -> m r -> m r -> m r
catching_ Getting (First a) SomeException a
l)
{-# INLINE handling_ #-}
trying :: MonadCatch m => Getting (First a) SomeException a -> m r -> m (Either a r)
trying :: Getting (First a) SomeException a -> m r -> m (Either a r)
trying Getting (First a) SomeException a
l = (SomeException -> Maybe a) -> m r -> m (Either a r)
forall (m :: * -> *) e b a.
(MonadCatch m, Exception e) =>
(e -> Maybe b) -> m a -> m (Either b a)
tryJust (Getting (First a) SomeException a -> SomeException -> Maybe a
forall s (m :: * -> *) a.
MonadReader s m =>
Getting (First a) s a -> m (Maybe a)
preview Getting (First a) SomeException a
l)
{-# INLINE trying #-}
trying_ :: MonadCatch m => Getting (First a) SomeException a -> m r -> m (Maybe r)
trying_ :: Getting (First a) SomeException a -> m r -> m (Maybe r)
trying_ Getting (First a) SomeException a
l m r
m = Getting (First r) (Either a r) r -> Either a r -> Maybe r
forall s (m :: * -> *) a.
MonadReader s m =>
Getting (First a) s a -> m (Maybe a)
preview Getting (First r) (Either a r) r
forall c a b. Prism (Either c a) (Either c b) a b
_Right (Either a r -> Maybe r) -> m (Either a r) -> m (Maybe r)
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
`liftM` Getting (First a) SomeException a -> m r -> m (Either a r)
forall (m :: * -> *) a r.
MonadCatch m =>
Getting (First a) SomeException a -> m r -> m (Either a r)
trying Getting (First a) SomeException a
l m r
m
{-# INLINE trying_ #-}
throwing :: AReview SomeException b -> b -> r
throwing :: AReview SomeException b -> b -> r
throwing AReview SomeException b
l = AReview SomeException b -> (SomeException -> r) -> b -> r
forall b (m :: * -> *) t r.
MonadReader b m =>
AReview t b -> (t -> r) -> m r
reviews AReview SomeException b
l SomeException -> r
forall a e. Exception e => e -> a
Exception.throw
{-# INLINE throwing #-}
throwing_ :: AReview SomeException () -> m x
throwing_ :: AReview SomeException () -> m x
throwing_ AReview SomeException ()
l = AReview SomeException () -> () -> m x
forall b r. AReview SomeException b -> b -> r
throwing AReview SomeException ()
l ()
{-# INLINE throwing_ #-}
throwingM :: MonadThrow m => AReview SomeException b -> b -> m r
throwingM :: AReview SomeException b -> b -> m r
throwingM AReview SomeException b
l = AReview SomeException b -> (SomeException -> m r) -> b -> m r
forall b (m :: * -> *) t r.
MonadReader b m =>
AReview t b -> (t -> r) -> m r
reviews AReview SomeException b
l SomeException -> m r
forall (m :: * -> *) e a. (MonadThrow m, Exception e) => e -> m a
throwM
{-# INLINE throwingM #-}
throwingTo :: MonadIO m => ThreadId -> AReview SomeException b -> b -> m ()
throwingTo :: ThreadId -> AReview SomeException b -> b -> m ()
throwingTo ThreadId
tid AReview SomeException b
l = AReview SomeException b -> (SomeException -> m ()) -> b -> m ()
forall b (m :: * -> *) t r.
MonadReader b m =>
AReview t b -> (t -> r) -> m r
reviews AReview SomeException b
l (IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ())
-> (SomeException -> IO ()) -> SomeException -> m ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ThreadId -> SomeException -> IO ()
forall e. Exception e => ThreadId -> e -> IO ()
throwTo ThreadId
tid)
{-# INLINE throwingTo #-}
mappedException :: (Exception e, Exception e') => Setter s s e e'
mappedException :: Setter s s e e'
mappedException = ((e -> e') -> s -> s) -> Optical (->) (->) f s s e e'
forall (p :: * -> * -> *) (q :: * -> * -> *) (f :: * -> *) a b s t.
(Profunctor p, Profunctor q, Settable f) =>
(p a b -> q s t) -> Optical p q f s t a b
sets (e -> e') -> s -> s
forall e1 e2 a.
(Exception e1, Exception e2) =>
(e1 -> e2) -> a -> a
mapException
{-# INLINE mappedException #-}
mappedException' :: Exception e' => Setter s s SomeException e'
mappedException' :: Setter s s SomeException e'
mappedException' = (SomeException -> f e') -> s -> f s
forall e e' s. (Exception e, Exception e') => Setter s s e e'
mappedException
{-# INLINE mappedException' #-}
class AsIOException t where
_IOException :: Prism' t IOException
instance AsIOException IOException where
_IOException :: p IOException (f IOException) -> p IOException (f IOException)
_IOException = p IOException (f IOException) -> p IOException (f IOException)
forall a. a -> a
id
{-# INLINE _IOException #-}
instance AsIOException SomeException where
_IOException :: p IOException (f IOException) -> p SomeException (f SomeException)
_IOException = p IOException (f IOException) -> p SomeException (f SomeException)
forall a. Exception a => Prism' SomeException a
exception
{-# INLINE _IOException #-}
#if __GLASGOW_HASKELL__ >= 710
pattern $bIOException_ :: IOException -> s
$mIOException_ :: forall r s.
AsIOException s =>
s -> (IOException -> r) -> (Void# -> r) -> r
IOException_ a <- (preview _IOException -> Just a) where
IOException_ IOException
a = AReview s IOException -> IOException -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s IOException
forall t. AsIOException t => Prism' t IOException
_IOException IOException
a
#endif
class AsArithException t where
_ArithException :: Prism' t ArithException
#if __GLASGOW_HASKELL__ >= 710
pattern $bArithException_ :: ArithException -> s
$mArithException_ :: forall r s.
AsArithException s =>
s -> (ArithException -> r) -> (Void# -> r) -> r
ArithException_ a <- (preview _ArithException -> Just a) where
ArithException_ ArithException
a = AReview s ArithException -> ArithException -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s ArithException
forall t. AsArithException t => Prism' t ArithException
_ArithException ArithException
a
#endif
instance AsArithException ArithException where
_ArithException :: p ArithException (f ArithException)
-> p ArithException (f ArithException)
_ArithException = p ArithException (f ArithException)
-> p ArithException (f ArithException)
forall a. a -> a
id
{-# INLINE _ArithException #-}
instance AsArithException SomeException where
_ArithException :: p ArithException (f ArithException)
-> p SomeException (f SomeException)
_ArithException = p ArithException (f ArithException)
-> p SomeException (f SomeException)
forall a. Exception a => Prism' SomeException a
exception
{-# INLINE _ArithException #-}
_Overflow :: AsArithException t => Prism' t ()
_Overflow :: Prism' t ()
_Overflow = p ArithException (f ArithException) -> p t (f t)
forall t. AsArithException t => Prism' t ArithException
_ArithException (p ArithException (f ArithException) -> p t (f t))
-> (p () (f ()) -> p ArithException (f ArithException))
-> p () (f ())
-> p t (f t)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ArithException -> Either (f ArithException) ())
-> (Either (f ArithException) (f ArithException)
-> f ArithException)
-> p (Either (f ArithException) ())
(Either (f ArithException) (f ArithException))
-> p ArithException (f ArithException)
forall (p :: * -> * -> *) a b c d.
Profunctor p =>
(a -> b) -> (c -> d) -> p b c -> p a d
dimap ArithException -> Either (f ArithException) ()
forall (f :: * -> *).
Applicative f =>
ArithException -> Either (f ArithException) ()
seta ((f ArithException -> f ArithException)
-> (f ArithException -> f ArithException)
-> Either (f ArithException) (f ArithException)
-> f ArithException
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
either f ArithException -> f ArithException
forall a. a -> a
id f ArithException -> f ArithException
forall a. a -> a
id) (p (Either (f ArithException) ())
(Either (f ArithException) (f ArithException))
-> p ArithException (f ArithException))
-> (p () (f ())
-> p (Either (f ArithException) ())
(Either (f ArithException) (f ArithException)))
-> p () (f ())
-> p ArithException (f ArithException)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. p () (f ArithException)
-> p (Either (f ArithException) ())
(Either (f ArithException) (f ArithException))
forall (p :: * -> * -> *) a b c.
Choice p =>
p a b -> p (Either c a) (Either c b)
right' (p () (f ArithException)
-> p (Either (f ArithException) ())
(Either (f ArithException) (f ArithException)))
-> (p () (f ()) -> p () (f ArithException))
-> p () (f ())
-> p (Either (f ArithException) ())
(Either (f ArithException) (f ArithException))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (f () -> f ArithException)
-> p () (f ()) -> p () (f ArithException)
forall (p :: * -> * -> *) b c a.
Profunctor p =>
(b -> c) -> p a b -> p a c
rmap (ArithException
Overflow ArithException -> f () -> f ArithException
forall (f :: * -> *) a b. Functor f => a -> f b -> f a
<$) where
seta :: ArithException -> Either (f ArithException) ()
seta ArithException
Overflow = () -> Either (f ArithException) ()
forall a b. b -> Either a b
Right ()
seta ArithException
t = f ArithException -> Either (f ArithException) ()
forall a b. a -> Either a b
Left (ArithException -> f ArithException
forall (f :: * -> *) a. Applicative f => a -> f a
pure ArithException
t)
{-# INLINE _Overflow #-}
#if __GLASGOW_HASKELL__ >= 710
pattern $bOverflow_ :: s
$mOverflow_ :: forall r s.
AsArithException s =>
s -> (Void# -> r) -> (Void# -> r) -> r
Overflow_ <- (has _Overflow -> True) where
Overflow_ = AReview s () -> () -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s ()
forall t. AsArithException t => Prism' t ()
_Overflow ()
#endif
_Underflow :: AsArithException t => Prism' t ()
_Underflow :: Prism' t ()
_Underflow = p ArithException (f ArithException) -> p t (f t)
forall t. AsArithException t => Prism' t ArithException
_ArithException (p ArithException (f ArithException) -> p t (f t))
-> (p () (f ()) -> p ArithException (f ArithException))
-> p () (f ())
-> p t (f t)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ArithException -> Either (f ArithException) ())
-> (Either (f ArithException) (f ArithException)
-> f ArithException)
-> p (Either (f ArithException) ())
(Either (f ArithException) (f ArithException))
-> p ArithException (f ArithException)
forall (p :: * -> * -> *) a b c d.
Profunctor p =>
(a -> b) -> (c -> d) -> p b c -> p a d
dimap ArithException -> Either (f ArithException) ()
forall (f :: * -> *).
Applicative f =>
ArithException -> Either (f ArithException) ()
seta ((f ArithException -> f ArithException)
-> (f ArithException -> f ArithException)
-> Either (f ArithException) (f ArithException)
-> f ArithException
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
either f ArithException -> f ArithException
forall a. a -> a
id f ArithException -> f ArithException
forall a. a -> a
id) (p (Either (f ArithException) ())
(Either (f ArithException) (f ArithException))
-> p ArithException (f ArithException))
-> (p () (f ())
-> p (Either (f ArithException) ())
(Either (f ArithException) (f ArithException)))
-> p () (f ())
-> p ArithException (f ArithException)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. p () (f ArithException)
-> p (Either (f ArithException) ())
(Either (f ArithException) (f ArithException))
forall (p :: * -> * -> *) a b c.
Choice p =>
p a b -> p (Either c a) (Either c b)
right' (p () (f ArithException)
-> p (Either (f ArithException) ())
(Either (f ArithException) (f ArithException)))
-> (p () (f ()) -> p () (f ArithException))
-> p () (f ())
-> p (Either (f ArithException) ())
(Either (f ArithException) (f ArithException))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (f () -> f ArithException)
-> p () (f ()) -> p () (f ArithException)
forall (p :: * -> * -> *) b c a.
Profunctor p =>
(b -> c) -> p a b -> p a c
rmap (ArithException
Underflow ArithException -> f () -> f ArithException
forall (f :: * -> *) a b. Functor f => a -> f b -> f a
<$) where
seta :: ArithException -> Either (f ArithException) ()
seta ArithException
Underflow = () -> Either (f ArithException) ()
forall a b. b -> Either a b
Right ()
seta ArithException
t = f ArithException -> Either (f ArithException) ()
forall a b. a -> Either a b
Left (ArithException -> f ArithException
forall (f :: * -> *) a. Applicative f => a -> f a
pure ArithException
t)
{-# INLINE _Underflow #-}
#if __GLASGOW_HASKELL__ >= 710
pattern $bUnderflow_ :: s
$mUnderflow_ :: forall r s.
AsArithException s =>
s -> (Void# -> r) -> (Void# -> r) -> r
Underflow_ <- (has _Underflow -> True) where
Underflow_ = AReview s () -> () -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s ()
forall t. AsArithException t => Prism' t ()
_Underflow ()
#endif
_LossOfPrecision :: AsArithException t => Prism' t ()
_LossOfPrecision :: Prism' t ()
_LossOfPrecision = p ArithException (f ArithException) -> p t (f t)
forall t. AsArithException t => Prism' t ArithException
_ArithException (p ArithException (f ArithException) -> p t (f t))
-> (p () (f ()) -> p ArithException (f ArithException))
-> p () (f ())
-> p t (f t)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ArithException -> Either (f ArithException) ())
-> (Either (f ArithException) (f ArithException)
-> f ArithException)
-> p (Either (f ArithException) ())
(Either (f ArithException) (f ArithException))
-> p ArithException (f ArithException)
forall (p :: * -> * -> *) a b c d.
Profunctor p =>
(a -> b) -> (c -> d) -> p b c -> p a d
dimap ArithException -> Either (f ArithException) ()
forall (f :: * -> *).
Applicative f =>
ArithException -> Either (f ArithException) ()
seta ((f ArithException -> f ArithException)
-> (f ArithException -> f ArithException)
-> Either (f ArithException) (f ArithException)
-> f ArithException
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
either f ArithException -> f ArithException
forall a. a -> a
id f ArithException -> f ArithException
forall a. a -> a
id) (p (Either (f ArithException) ())
(Either (f ArithException) (f ArithException))
-> p ArithException (f ArithException))
-> (p () (f ())
-> p (Either (f ArithException) ())
(Either (f ArithException) (f ArithException)))
-> p () (f ())
-> p ArithException (f ArithException)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. p () (f ArithException)
-> p (Either (f ArithException) ())
(Either (f ArithException) (f ArithException))
forall (p :: * -> * -> *) a b c.
Choice p =>
p a b -> p (Either c a) (Either c b)
right' (p () (f ArithException)
-> p (Either (f ArithException) ())
(Either (f ArithException) (f ArithException)))
-> (p () (f ()) -> p () (f ArithException))
-> p () (f ())
-> p (Either (f ArithException) ())
(Either (f ArithException) (f ArithException))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (f () -> f ArithException)
-> p () (f ()) -> p () (f ArithException)
forall (p :: * -> * -> *) b c a.
Profunctor p =>
(b -> c) -> p a b -> p a c
rmap (ArithException
LossOfPrecision ArithException -> f () -> f ArithException
forall (f :: * -> *) a b. Functor f => a -> f b -> f a
<$) where
seta :: ArithException -> Either (f ArithException) ()
seta ArithException
LossOfPrecision = () -> Either (f ArithException) ()
forall a b. b -> Either a b
Right ()
seta ArithException
t = f ArithException -> Either (f ArithException) ()
forall a b. a -> Either a b
Left (ArithException -> f ArithException
forall (f :: * -> *) a. Applicative f => a -> f a
pure ArithException
t)
{-# INLINE _LossOfPrecision #-}
#if __GLASGOW_HASKELL__ >= 710
pattern $bLossOfPrecision_ :: s
$mLossOfPrecision_ :: forall r s.
AsArithException s =>
s -> (Void# -> r) -> (Void# -> r) -> r
LossOfPrecision_ <- (has _LossOfPrecision -> True) where
LossOfPrecision_ = AReview s () -> () -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s ()
forall t. AsArithException t => Prism' t ()
_LossOfPrecision ()
#endif
_DivideByZero :: AsArithException t => Prism' t ()
_DivideByZero :: Prism' t ()
_DivideByZero = p ArithException (f ArithException) -> p t (f t)
forall t. AsArithException t => Prism' t ArithException
_ArithException (p ArithException (f ArithException) -> p t (f t))
-> (p () (f ()) -> p ArithException (f ArithException))
-> p () (f ())
-> p t (f t)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ArithException -> Either (f ArithException) ())
-> (Either (f ArithException) (f ArithException)
-> f ArithException)
-> p (Either (f ArithException) ())
(Either (f ArithException) (f ArithException))
-> p ArithException (f ArithException)
forall (p :: * -> * -> *) a b c d.
Profunctor p =>
(a -> b) -> (c -> d) -> p b c -> p a d
dimap ArithException -> Either (f ArithException) ()
forall (f :: * -> *).
Applicative f =>
ArithException -> Either (f ArithException) ()
seta ((f ArithException -> f ArithException)
-> (f ArithException -> f ArithException)
-> Either (f ArithException) (f ArithException)
-> f ArithException
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
either f ArithException -> f ArithException
forall a. a -> a
id f ArithException -> f ArithException
forall a. a -> a
id) (p (Either (f ArithException) ())
(Either (f ArithException) (f ArithException))
-> p ArithException (f ArithException))
-> (p () (f ())
-> p (Either (f ArithException) ())
(Either (f ArithException) (f ArithException)))
-> p () (f ())
-> p ArithException (f ArithException)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. p () (f ArithException)
-> p (Either (f ArithException) ())
(Either (f ArithException) (f ArithException))
forall (p :: * -> * -> *) a b c.
Choice p =>
p a b -> p (Either c a) (Either c b)
right' (p () (f ArithException)
-> p (Either (f ArithException) ())
(Either (f ArithException) (f ArithException)))
-> (p () (f ()) -> p () (f ArithException))
-> p () (f ())
-> p (Either (f ArithException) ())
(Either (f ArithException) (f ArithException))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (f () -> f ArithException)
-> p () (f ()) -> p () (f ArithException)
forall (p :: * -> * -> *) b c a.
Profunctor p =>
(b -> c) -> p a b -> p a c
rmap (ArithException
DivideByZero ArithException -> f () -> f ArithException
forall (f :: * -> *) a b. Functor f => a -> f b -> f a
<$) where
seta :: ArithException -> Either (f ArithException) ()
seta ArithException
DivideByZero = () -> Either (f ArithException) ()
forall a b. b -> Either a b
Right ()
seta ArithException
t = f ArithException -> Either (f ArithException) ()
forall a b. a -> Either a b
Left (ArithException -> f ArithException
forall (f :: * -> *) a. Applicative f => a -> f a
pure ArithException
t)
{-# INLINE _DivideByZero #-}
#if __GLASGOW_HASKELL__ >= 710
pattern $bDivideByZero_ :: s
$mDivideByZero_ :: forall r s.
AsArithException s =>
s -> (Void# -> r) -> (Void# -> r) -> r
DivideByZero_ <- (has _DivideByZero -> True) where
DivideByZero_ = AReview s () -> () -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s ()
forall t. AsArithException t => Prism' t ()
_DivideByZero ()
#endif
_Denormal :: AsArithException t => Prism' t ()
_Denormal :: Prism' t ()
_Denormal = p ArithException (f ArithException) -> p t (f t)
forall t. AsArithException t => Prism' t ArithException
_ArithException (p ArithException (f ArithException) -> p t (f t))
-> (p () (f ()) -> p ArithException (f ArithException))
-> p () (f ())
-> p t (f t)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ArithException -> Either (f ArithException) ())
-> (Either (f ArithException) (f ArithException)
-> f ArithException)
-> p (Either (f ArithException) ())
(Either (f ArithException) (f ArithException))
-> p ArithException (f ArithException)
forall (p :: * -> * -> *) a b c d.
Profunctor p =>
(a -> b) -> (c -> d) -> p b c -> p a d
dimap ArithException -> Either (f ArithException) ()
forall (f :: * -> *).
Applicative f =>
ArithException -> Either (f ArithException) ()
seta ((f ArithException -> f ArithException)
-> (f ArithException -> f ArithException)
-> Either (f ArithException) (f ArithException)
-> f ArithException
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
either f ArithException -> f ArithException
forall a. a -> a
id f ArithException -> f ArithException
forall a. a -> a
id) (p (Either (f ArithException) ())
(Either (f ArithException) (f ArithException))
-> p ArithException (f ArithException))
-> (p () (f ())
-> p (Either (f ArithException) ())
(Either (f ArithException) (f ArithException)))
-> p () (f ())
-> p ArithException (f ArithException)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. p () (f ArithException)
-> p (Either (f ArithException) ())
(Either (f ArithException) (f ArithException))
forall (p :: * -> * -> *) a b c.
Choice p =>
p a b -> p (Either c a) (Either c b)
right' (p () (f ArithException)
-> p (Either (f ArithException) ())
(Either (f ArithException) (f ArithException)))
-> (p () (f ()) -> p () (f ArithException))
-> p () (f ())
-> p (Either (f ArithException) ())
(Either (f ArithException) (f ArithException))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (f () -> f ArithException)
-> p () (f ()) -> p () (f ArithException)
forall (p :: * -> * -> *) b c a.
Profunctor p =>
(b -> c) -> p a b -> p a c
rmap (ArithException
Denormal ArithException -> f () -> f ArithException
forall (f :: * -> *) a b. Functor f => a -> f b -> f a
<$) where
seta :: ArithException -> Either (f ArithException) ()
seta ArithException
Denormal = () -> Either (f ArithException) ()
forall a b. b -> Either a b
Right ()
seta ArithException
t = f ArithException -> Either (f ArithException) ()
forall a b. a -> Either a b
Left (ArithException -> f ArithException
forall (f :: * -> *) a. Applicative f => a -> f a
pure ArithException
t)
{-# INLINE _Denormal #-}
#if __GLASGOW_HASKELL__ >= 710
pattern $bDenormal_ :: s
$mDenormal_ :: forall r s.
AsArithException s =>
s -> (Void# -> r) -> (Void# -> r) -> r
Denormal_ <- (has _Denormal -> True) where
Denormal_ = AReview s () -> () -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s ()
forall t. AsArithException t => Prism' t ()
_Denormal ()
#endif
_RatioZeroDenominator :: AsArithException t => Prism' t ()
_RatioZeroDenominator :: Prism' t ()
_RatioZeroDenominator = p ArithException (f ArithException) -> p t (f t)
forall t. AsArithException t => Prism' t ArithException
_ArithException (p ArithException (f ArithException) -> p t (f t))
-> (p () (f ()) -> p ArithException (f ArithException))
-> p () (f ())
-> p t (f t)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ArithException -> Either (f ArithException) ())
-> (Either (f ArithException) (f ArithException)
-> f ArithException)
-> p (Either (f ArithException) ())
(Either (f ArithException) (f ArithException))
-> p ArithException (f ArithException)
forall (p :: * -> * -> *) a b c d.
Profunctor p =>
(a -> b) -> (c -> d) -> p b c -> p a d
dimap ArithException -> Either (f ArithException) ()
forall (f :: * -> *).
Applicative f =>
ArithException -> Either (f ArithException) ()
seta ((f ArithException -> f ArithException)
-> (f ArithException -> f ArithException)
-> Either (f ArithException) (f ArithException)
-> f ArithException
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
either f ArithException -> f ArithException
forall a. a -> a
id f ArithException -> f ArithException
forall a. a -> a
id) (p (Either (f ArithException) ())
(Either (f ArithException) (f ArithException))
-> p ArithException (f ArithException))
-> (p () (f ())
-> p (Either (f ArithException) ())
(Either (f ArithException) (f ArithException)))
-> p () (f ())
-> p ArithException (f ArithException)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. p () (f ArithException)
-> p (Either (f ArithException) ())
(Either (f ArithException) (f ArithException))
forall (p :: * -> * -> *) a b c.
Choice p =>
p a b -> p (Either c a) (Either c b)
right' (p () (f ArithException)
-> p (Either (f ArithException) ())
(Either (f ArithException) (f ArithException)))
-> (p () (f ()) -> p () (f ArithException))
-> p () (f ())
-> p (Either (f ArithException) ())
(Either (f ArithException) (f ArithException))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (f () -> f ArithException)
-> p () (f ()) -> p () (f ArithException)
forall (p :: * -> * -> *) b c a.
Profunctor p =>
(b -> c) -> p a b -> p a c
rmap (ArithException
RatioZeroDenominator ArithException -> f () -> f ArithException
forall (f :: * -> *) a b. Functor f => a -> f b -> f a
<$) where
seta :: ArithException -> Either (f ArithException) ()
seta ArithException
RatioZeroDenominator = () -> Either (f ArithException) ()
forall a b. b -> Either a b
Right ()
seta ArithException
t = f ArithException -> Either (f ArithException) ()
forall a b. a -> Either a b
Left (ArithException -> f ArithException
forall (f :: * -> *) a. Applicative f => a -> f a
pure ArithException
t)
{-# INLINE _RatioZeroDenominator #-}
#if __GLASGOW_HASKELL__ >= 710
pattern $bRatioZeroDenominator_ :: s
$mRatioZeroDenominator_ :: forall r s.
AsArithException s =>
s -> (Void# -> r) -> (Void# -> r) -> r
RatioZeroDenominator_ <- (has _RatioZeroDenominator -> True) where
RatioZeroDenominator_ = AReview s () -> () -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s ()
forall t. AsArithException t => Prism' t ()
_RatioZeroDenominator ()
#endif
class AsArrayException t where
_ArrayException :: Prism' t ArrayException
instance AsArrayException ArrayException where
_ArrayException :: p ArrayException (f ArrayException)
-> p ArrayException (f ArrayException)
_ArrayException = p ArrayException (f ArrayException)
-> p ArrayException (f ArrayException)
forall a. a -> a
id
{-# INLINE _ArrayException #-}
instance AsArrayException SomeException where
_ArrayException :: p ArrayException (f ArrayException)
-> p SomeException (f SomeException)
_ArrayException = p ArrayException (f ArrayException)
-> p SomeException (f SomeException)
forall a. Exception a => Prism' SomeException a
exception
{-# INLINE _ArrayException #-}
#if __GLASGOW_HASKELL__ >= 710
pattern $bArrayException_ :: ArrayException -> s
$mArrayException_ :: forall r s.
AsArrayException s =>
s -> (ArrayException -> r) -> (Void# -> r) -> r
ArrayException_ e <- (preview _ArrayException -> Just e) where
ArrayException_ ArrayException
e = AReview s ArrayException -> ArrayException -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s ArrayException
forall t. AsArrayException t => Prism' t ArrayException
_ArrayException ArrayException
e
#endif
_IndexOutOfBounds :: AsArrayException t => Prism' t String
_IndexOutOfBounds :: Prism' t String
_IndexOutOfBounds = p ArrayException (f ArrayException) -> p t (f t)
forall t. AsArrayException t => Prism' t ArrayException
_ArrayException (p ArrayException (f ArrayException) -> p t (f t))
-> (p String (f String) -> p ArrayException (f ArrayException))
-> p String (f String)
-> p t (f t)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ArrayException -> Either (f ArrayException) String)
-> (Either (f ArrayException) (f ArrayException)
-> f ArrayException)
-> p (Either (f ArrayException) String)
(Either (f ArrayException) (f ArrayException))
-> p ArrayException (f ArrayException)
forall (p :: * -> * -> *) a b c d.
Profunctor p =>
(a -> b) -> (c -> d) -> p b c -> p a d
dimap ArrayException -> Either (f ArrayException) String
forall (f :: * -> *).
Applicative f =>
ArrayException -> Either (f ArrayException) String
seta ((f ArrayException -> f ArrayException)
-> (f ArrayException -> f ArrayException)
-> Either (f ArrayException) (f ArrayException)
-> f ArrayException
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
either f ArrayException -> f ArrayException
forall a. a -> a
id f ArrayException -> f ArrayException
forall a. a -> a
id) (p (Either (f ArrayException) String)
(Either (f ArrayException) (f ArrayException))
-> p ArrayException (f ArrayException))
-> (p String (f String)
-> p (Either (f ArrayException) String)
(Either (f ArrayException) (f ArrayException)))
-> p String (f String)
-> p ArrayException (f ArrayException)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. p String (f ArrayException)
-> p (Either (f ArrayException) String)
(Either (f ArrayException) (f ArrayException))
forall (p :: * -> * -> *) a b c.
Choice p =>
p a b -> p (Either c a) (Either c b)
right' (p String (f ArrayException)
-> p (Either (f ArrayException) String)
(Either (f ArrayException) (f ArrayException)))
-> (p String (f String) -> p String (f ArrayException))
-> p String (f String)
-> p (Either (f ArrayException) String)
(Either (f ArrayException) (f ArrayException))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (f String -> f ArrayException)
-> p String (f String) -> p String (f ArrayException)
forall (p :: * -> * -> *) b c a.
Profunctor p =>
(b -> c) -> p a b -> p a c
rmap ((String -> ArrayException) -> f String -> f ArrayException
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap String -> ArrayException
IndexOutOfBounds) where
seta :: ArrayException -> Either (f ArrayException) String
seta (IndexOutOfBounds String
r) = String -> Either (f ArrayException) String
forall a b. b -> Either a b
Right String
r
seta ArrayException
t = f ArrayException -> Either (f ArrayException) String
forall a b. a -> Either a b
Left (ArrayException -> f ArrayException
forall (f :: * -> *) a. Applicative f => a -> f a
pure ArrayException
t)
{-# INLINE _IndexOutOfBounds #-}
#if __GLASGOW_HASKELL__ >= 710
pattern $bIndexOutOfBounds_ :: String -> s
$mIndexOutOfBounds_ :: forall r s.
AsArrayException s =>
s -> (String -> r) -> (Void# -> r) -> r
IndexOutOfBounds_ e <- (preview _IndexOutOfBounds -> Just e) where
IndexOutOfBounds_ String
e = AReview s String -> String -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s String
forall t. AsArrayException t => Prism' t String
_IndexOutOfBounds String
e
#endif
_UndefinedElement :: AsArrayException t => Prism' t String
_UndefinedElement :: Prism' t String
_UndefinedElement = p ArrayException (f ArrayException) -> p t (f t)
forall t. AsArrayException t => Prism' t ArrayException
_ArrayException (p ArrayException (f ArrayException) -> p t (f t))
-> (p String (f String) -> p ArrayException (f ArrayException))
-> p String (f String)
-> p t (f t)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ArrayException -> Either (f ArrayException) String)
-> (Either (f ArrayException) (f ArrayException)
-> f ArrayException)
-> p (Either (f ArrayException) String)
(Either (f ArrayException) (f ArrayException))
-> p ArrayException (f ArrayException)
forall (p :: * -> * -> *) a b c d.
Profunctor p =>
(a -> b) -> (c -> d) -> p b c -> p a d
dimap ArrayException -> Either (f ArrayException) String
forall (f :: * -> *).
Applicative f =>
ArrayException -> Either (f ArrayException) String
seta ((f ArrayException -> f ArrayException)
-> (f ArrayException -> f ArrayException)
-> Either (f ArrayException) (f ArrayException)
-> f ArrayException
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
either f ArrayException -> f ArrayException
forall a. a -> a
id f ArrayException -> f ArrayException
forall a. a -> a
id) (p (Either (f ArrayException) String)
(Either (f ArrayException) (f ArrayException))
-> p ArrayException (f ArrayException))
-> (p String (f String)
-> p (Either (f ArrayException) String)
(Either (f ArrayException) (f ArrayException)))
-> p String (f String)
-> p ArrayException (f ArrayException)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. p String (f ArrayException)
-> p (Either (f ArrayException) String)
(Either (f ArrayException) (f ArrayException))
forall (p :: * -> * -> *) a b c.
Choice p =>
p a b -> p (Either c a) (Either c b)
right' (p String (f ArrayException)
-> p (Either (f ArrayException) String)
(Either (f ArrayException) (f ArrayException)))
-> (p String (f String) -> p String (f ArrayException))
-> p String (f String)
-> p (Either (f ArrayException) String)
(Either (f ArrayException) (f ArrayException))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (f String -> f ArrayException)
-> p String (f String) -> p String (f ArrayException)
forall (p :: * -> * -> *) b c a.
Profunctor p =>
(b -> c) -> p a b -> p a c
rmap ((String -> ArrayException) -> f String -> f ArrayException
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap String -> ArrayException
UndefinedElement) where
seta :: ArrayException -> Either (f ArrayException) String
seta (UndefinedElement String
r) = String -> Either (f ArrayException) String
forall a b. b -> Either a b
Right String
r
seta ArrayException
t = f ArrayException -> Either (f ArrayException) String
forall a b. a -> Either a b
Left (ArrayException -> f ArrayException
forall (f :: * -> *) a. Applicative f => a -> f a
pure ArrayException
t)
{-# INLINE _UndefinedElement #-}
#if __GLASGOW_HASKELL__ >= 710
pattern $bUndefinedElement_ :: String -> s
$mUndefinedElement_ :: forall r s.
AsArrayException s =>
s -> (String -> r) -> (Void# -> r) -> r
UndefinedElement_ e <- (preview _UndefinedElement -> Just e) where
UndefinedElement_ String
e = AReview s String -> String -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s String
forall t. AsArrayException t => Prism' t String
_UndefinedElement String
e
#endif
class AsAssertionFailed t where
__AssertionFailed :: Prism' t AssertionFailed
_AssertionFailed :: Prism' t String
_AssertionFailed = p AssertionFailed (f AssertionFailed) -> p t (f t)
forall t. AsAssertionFailed t => Prism' t AssertionFailed
__AssertionFailed(p AssertionFailed (f AssertionFailed) -> p t (f t))
-> (p String (f String) -> p AssertionFailed (f AssertionFailed))
-> p String (f String)
-> p t (f t)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.p String (f String) -> p AssertionFailed (f AssertionFailed)
forall t. AsAssertionFailed t => Prism' t String
_AssertionFailed
{-# INLINE _AssertionFailed #-}
instance AsAssertionFailed AssertionFailed where
__AssertionFailed :: p AssertionFailed (f AssertionFailed)
-> p AssertionFailed (f AssertionFailed)
__AssertionFailed = p AssertionFailed (f AssertionFailed)
-> p AssertionFailed (f AssertionFailed)
forall a. a -> a
id
{-# INLINE __AssertionFailed #-}
_AssertionFailed :: p String (f String) -> p AssertionFailed (f AssertionFailed)
_AssertionFailed = (Unwrapped AssertionFailed -> AssertionFailed)
-> Iso
AssertionFailed
AssertionFailed
(Unwrapped AssertionFailed)
(Unwrapped AssertionFailed)
forall s t.
Rewrapping s t =>
(Unwrapped s -> s) -> Iso s t (Unwrapped s) (Unwrapped t)
_Wrapping String -> AssertionFailed
Unwrapped AssertionFailed -> AssertionFailed
AssertionFailed
{-# INLINE _AssertionFailed #-}
instance AsAssertionFailed SomeException where
__AssertionFailed :: p AssertionFailed (f AssertionFailed)
-> p SomeException (f SomeException)
__AssertionFailed = p AssertionFailed (f AssertionFailed)
-> p SomeException (f SomeException)
forall a. Exception a => Prism' SomeException a
exception
{-# INLINE __AssertionFailed #-}
#if __GLASGOW_HASKELL__ >= 710
pattern $bAssertionFailed__ :: AssertionFailed -> s
$mAssertionFailed__ :: forall r s.
AsAssertionFailed s =>
s -> (AssertionFailed -> r) -> (Void# -> r) -> r
AssertionFailed__ e <- (preview __AssertionFailed -> Just e) where
AssertionFailed__ AssertionFailed
e = AReview s AssertionFailed -> AssertionFailed -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s AssertionFailed
forall t. AsAssertionFailed t => Prism' t AssertionFailed
__AssertionFailed AssertionFailed
e
pattern $bAssertionFailed_ :: String -> s
$mAssertionFailed_ :: forall r s.
AsAssertionFailed s =>
s -> (String -> r) -> (Void# -> r) -> r
AssertionFailed_ e <- (preview _AssertionFailed -> Just e) where
AssertionFailed_ String
e = AReview s String -> String -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s String
forall t. AsAssertionFailed t => Prism' t String
_AssertionFailed String
e
#endif
class AsAsyncException t where
_AsyncException :: Prism' t AsyncException
instance AsAsyncException AsyncException where
_AsyncException :: p AsyncException (f AsyncException)
-> p AsyncException (f AsyncException)
_AsyncException = p AsyncException (f AsyncException)
-> p AsyncException (f AsyncException)
forall a. a -> a
id
{-# INLINE _AsyncException #-}
instance AsAsyncException SomeException where
_AsyncException :: p AsyncException (f AsyncException)
-> p SomeException (f SomeException)
_AsyncException = p AsyncException (f AsyncException)
-> p SomeException (f SomeException)
forall a. Exception a => Prism' SomeException a
exception
{-# INLINE _AsyncException #-}
#if __GLASGOW_HASKELL__ >= 710
pattern $bAsyncException_ :: AsyncException -> s
$mAsyncException_ :: forall r s.
AsAsyncException s =>
s -> (AsyncException -> r) -> (Void# -> r) -> r
AsyncException_ e <- (preview _AsyncException -> Just e) where
AsyncException_ AsyncException
e = AReview s AsyncException -> AsyncException -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s AsyncException
forall t. AsAsyncException t => Prism' t AsyncException
_AsyncException AsyncException
e
#endif
_StackOverflow :: AsAsyncException t => Prism' t ()
_StackOverflow :: Prism' t ()
_StackOverflow = p AsyncException (f AsyncException) -> p t (f t)
forall t. AsAsyncException t => Prism' t AsyncException
_AsyncException (p AsyncException (f AsyncException) -> p t (f t))
-> (p () (f ()) -> p AsyncException (f AsyncException))
-> p () (f ())
-> p t (f t)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (AsyncException -> Either (f AsyncException) ())
-> (Either (f AsyncException) (f AsyncException)
-> f AsyncException)
-> p (Either (f AsyncException) ())
(Either (f AsyncException) (f AsyncException))
-> p AsyncException (f AsyncException)
forall (p :: * -> * -> *) a b c d.
Profunctor p =>
(a -> b) -> (c -> d) -> p b c -> p a d
dimap AsyncException -> Either (f AsyncException) ()
forall (f :: * -> *).
Applicative f =>
AsyncException -> Either (f AsyncException) ()
seta ((f AsyncException -> f AsyncException)
-> (f AsyncException -> f AsyncException)
-> Either (f AsyncException) (f AsyncException)
-> f AsyncException
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
either f AsyncException -> f AsyncException
forall a. a -> a
id f AsyncException -> f AsyncException
forall a. a -> a
id) (p (Either (f AsyncException) ())
(Either (f AsyncException) (f AsyncException))
-> p AsyncException (f AsyncException))
-> (p () (f ())
-> p (Either (f AsyncException) ())
(Either (f AsyncException) (f AsyncException)))
-> p () (f ())
-> p AsyncException (f AsyncException)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. p () (f AsyncException)
-> p (Either (f AsyncException) ())
(Either (f AsyncException) (f AsyncException))
forall (p :: * -> * -> *) a b c.
Choice p =>
p a b -> p (Either c a) (Either c b)
right' (p () (f AsyncException)
-> p (Either (f AsyncException) ())
(Either (f AsyncException) (f AsyncException)))
-> (p () (f ()) -> p () (f AsyncException))
-> p () (f ())
-> p (Either (f AsyncException) ())
(Either (f AsyncException) (f AsyncException))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (f () -> f AsyncException)
-> p () (f ()) -> p () (f AsyncException)
forall (p :: * -> * -> *) b c a.
Profunctor p =>
(b -> c) -> p a b -> p a c
rmap (AsyncException
StackOverflow AsyncException -> f () -> f AsyncException
forall (f :: * -> *) a b. Functor f => a -> f b -> f a
<$) where
seta :: AsyncException -> Either (f AsyncException) ()
seta AsyncException
StackOverflow = () -> Either (f AsyncException) ()
forall a b. b -> Either a b
Right ()
seta AsyncException
t = f AsyncException -> Either (f AsyncException) ()
forall a b. a -> Either a b
Left (AsyncException -> f AsyncException
forall (f :: * -> *) a. Applicative f => a -> f a
pure AsyncException
t)
{-# INLINE _StackOverflow #-}
#if __GLASGOW_HASKELL__ >= 710
pattern $bStackOverflow_ :: s
$mStackOverflow_ :: forall r s.
AsAsyncException s =>
s -> (Void# -> r) -> (Void# -> r) -> r
StackOverflow_ <- (has _StackOverflow -> True) where
StackOverflow_ = AReview s () -> () -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s ()
forall t. AsAsyncException t => Prism' t ()
_StackOverflow ()
#endif
_HeapOverflow :: AsAsyncException t => Prism' t ()
_HeapOverflow :: Prism' t ()
_HeapOverflow = p AsyncException (f AsyncException) -> p t (f t)
forall t. AsAsyncException t => Prism' t AsyncException
_AsyncException (p AsyncException (f AsyncException) -> p t (f t))
-> (p () (f ()) -> p AsyncException (f AsyncException))
-> p () (f ())
-> p t (f t)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (AsyncException -> Either (f AsyncException) ())
-> (Either (f AsyncException) (f AsyncException)
-> f AsyncException)
-> p (Either (f AsyncException) ())
(Either (f AsyncException) (f AsyncException))
-> p AsyncException (f AsyncException)
forall (p :: * -> * -> *) a b c d.
Profunctor p =>
(a -> b) -> (c -> d) -> p b c -> p a d
dimap AsyncException -> Either (f AsyncException) ()
forall (f :: * -> *).
Applicative f =>
AsyncException -> Either (f AsyncException) ()
seta ((f AsyncException -> f AsyncException)
-> (f AsyncException -> f AsyncException)
-> Either (f AsyncException) (f AsyncException)
-> f AsyncException
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
either f AsyncException -> f AsyncException
forall a. a -> a
id f AsyncException -> f AsyncException
forall a. a -> a
id) (p (Either (f AsyncException) ())
(Either (f AsyncException) (f AsyncException))
-> p AsyncException (f AsyncException))
-> (p () (f ())
-> p (Either (f AsyncException) ())
(Either (f AsyncException) (f AsyncException)))
-> p () (f ())
-> p AsyncException (f AsyncException)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. p () (f AsyncException)
-> p (Either (f AsyncException) ())
(Either (f AsyncException) (f AsyncException))
forall (p :: * -> * -> *) a b c.
Choice p =>
p a b -> p (Either c a) (Either c b)
right' (p () (f AsyncException)
-> p (Either (f AsyncException) ())
(Either (f AsyncException) (f AsyncException)))
-> (p () (f ()) -> p () (f AsyncException))
-> p () (f ())
-> p (Either (f AsyncException) ())
(Either (f AsyncException) (f AsyncException))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (f () -> f AsyncException)
-> p () (f ()) -> p () (f AsyncException)
forall (p :: * -> * -> *) b c a.
Profunctor p =>
(b -> c) -> p a b -> p a c
rmap (AsyncException
HeapOverflow AsyncException -> f () -> f AsyncException
forall (f :: * -> *) a b. Functor f => a -> f b -> f a
<$) where
seta :: AsyncException -> Either (f AsyncException) ()
seta AsyncException
HeapOverflow = () -> Either (f AsyncException) ()
forall a b. b -> Either a b
Right ()
seta AsyncException
t = f AsyncException -> Either (f AsyncException) ()
forall a b. a -> Either a b
Left (AsyncException -> f AsyncException
forall (f :: * -> *) a. Applicative f => a -> f a
pure AsyncException
t)
{-# INLINE _HeapOverflow #-}
#if __GLASGOW_HASKELL__ >= 710
pattern $bHeapOverflow_ :: s
$mHeapOverflow_ :: forall r s.
AsAsyncException s =>
s -> (Void# -> r) -> (Void# -> r) -> r
HeapOverflow_ <- (has _HeapOverflow -> True) where
HeapOverflow_ = AReview s () -> () -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s ()
forall t. AsAsyncException t => Prism' t ()
_HeapOverflow ()
#endif
_ThreadKilled :: AsAsyncException t => Prism' t ()
_ThreadKilled :: Prism' t ()
_ThreadKilled = p AsyncException (f AsyncException) -> p t (f t)
forall t. AsAsyncException t => Prism' t AsyncException
_AsyncException (p AsyncException (f AsyncException) -> p t (f t))
-> (p () (f ()) -> p AsyncException (f AsyncException))
-> p () (f ())
-> p t (f t)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (AsyncException -> Either (f AsyncException) ())
-> (Either (f AsyncException) (f AsyncException)
-> f AsyncException)
-> p (Either (f AsyncException) ())
(Either (f AsyncException) (f AsyncException))
-> p AsyncException (f AsyncException)
forall (p :: * -> * -> *) a b c d.
Profunctor p =>
(a -> b) -> (c -> d) -> p b c -> p a d
dimap AsyncException -> Either (f AsyncException) ()
forall (f :: * -> *).
Applicative f =>
AsyncException -> Either (f AsyncException) ()
seta ((f AsyncException -> f AsyncException)
-> (f AsyncException -> f AsyncException)
-> Either (f AsyncException) (f AsyncException)
-> f AsyncException
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
either f AsyncException -> f AsyncException
forall a. a -> a
id f AsyncException -> f AsyncException
forall a. a -> a
id) (p (Either (f AsyncException) ())
(Either (f AsyncException) (f AsyncException))
-> p AsyncException (f AsyncException))
-> (p () (f ())
-> p (Either (f AsyncException) ())
(Either (f AsyncException) (f AsyncException)))
-> p () (f ())
-> p AsyncException (f AsyncException)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. p () (f AsyncException)
-> p (Either (f AsyncException) ())
(Either (f AsyncException) (f AsyncException))
forall (p :: * -> * -> *) a b c.
Choice p =>
p a b -> p (Either c a) (Either c b)
right' (p () (f AsyncException)
-> p (Either (f AsyncException) ())
(Either (f AsyncException) (f AsyncException)))
-> (p () (f ()) -> p () (f AsyncException))
-> p () (f ())
-> p (Either (f AsyncException) ())
(Either (f AsyncException) (f AsyncException))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (f () -> f AsyncException)
-> p () (f ()) -> p () (f AsyncException)
forall (p :: * -> * -> *) b c a.
Profunctor p =>
(b -> c) -> p a b -> p a c
rmap (AsyncException
ThreadKilled AsyncException -> f () -> f AsyncException
forall (f :: * -> *) a b. Functor f => a -> f b -> f a
<$) where
seta :: AsyncException -> Either (f AsyncException) ()
seta AsyncException
ThreadKilled = () -> Either (f AsyncException) ()
forall a b. b -> Either a b
Right ()
seta AsyncException
t = f AsyncException -> Either (f AsyncException) ()
forall a b. a -> Either a b
Left (AsyncException -> f AsyncException
forall (f :: * -> *) a. Applicative f => a -> f a
pure AsyncException
t)
{-# INLINE _ThreadKilled #-}
#if __GLASGOW_HASKELL__ >= 710
pattern $bThreadKilled_ :: s
$mThreadKilled_ :: forall r s.
AsAsyncException s =>
s -> (Void# -> r) -> (Void# -> r) -> r
ThreadKilled_ <- (has _ThreadKilled -> True) where
ThreadKilled_ = AReview s () -> () -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s ()
forall t. AsAsyncException t => Prism' t ()
_ThreadKilled ()
#endif
_UserInterrupt :: AsAsyncException t => Prism' t ()
_UserInterrupt :: Prism' t ()
_UserInterrupt = p AsyncException (f AsyncException) -> p t (f t)
forall t. AsAsyncException t => Prism' t AsyncException
_AsyncException (p AsyncException (f AsyncException) -> p t (f t))
-> (p () (f ()) -> p AsyncException (f AsyncException))
-> p () (f ())
-> p t (f t)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (AsyncException -> Either (f AsyncException) ())
-> (Either (f AsyncException) (f AsyncException)
-> f AsyncException)
-> p (Either (f AsyncException) ())
(Either (f AsyncException) (f AsyncException))
-> p AsyncException (f AsyncException)
forall (p :: * -> * -> *) a b c d.
Profunctor p =>
(a -> b) -> (c -> d) -> p b c -> p a d
dimap AsyncException -> Either (f AsyncException) ()
forall (f :: * -> *).
Applicative f =>
AsyncException -> Either (f AsyncException) ()
seta ((f AsyncException -> f AsyncException)
-> (f AsyncException -> f AsyncException)
-> Either (f AsyncException) (f AsyncException)
-> f AsyncException
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
either f AsyncException -> f AsyncException
forall a. a -> a
id f AsyncException -> f AsyncException
forall a. a -> a
id) (p (Either (f AsyncException) ())
(Either (f AsyncException) (f AsyncException))
-> p AsyncException (f AsyncException))
-> (p () (f ())
-> p (Either (f AsyncException) ())
(Either (f AsyncException) (f AsyncException)))
-> p () (f ())
-> p AsyncException (f AsyncException)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. p () (f AsyncException)
-> p (Either (f AsyncException) ())
(Either (f AsyncException) (f AsyncException))
forall (p :: * -> * -> *) a b c.
Choice p =>
p a b -> p (Either c a) (Either c b)
right' (p () (f AsyncException)
-> p (Either (f AsyncException) ())
(Either (f AsyncException) (f AsyncException)))
-> (p () (f ()) -> p () (f AsyncException))
-> p () (f ())
-> p (Either (f AsyncException) ())
(Either (f AsyncException) (f AsyncException))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (f () -> f AsyncException)
-> p () (f ()) -> p () (f AsyncException)
forall (p :: * -> * -> *) b c a.
Profunctor p =>
(b -> c) -> p a b -> p a c
rmap (AsyncException
UserInterrupt AsyncException -> f () -> f AsyncException
forall (f :: * -> *) a b. Functor f => a -> f b -> f a
<$) where
seta :: AsyncException -> Either (f AsyncException) ()
seta AsyncException
UserInterrupt = () -> Either (f AsyncException) ()
forall a b. b -> Either a b
Right ()
seta AsyncException
t = f AsyncException -> Either (f AsyncException) ()
forall a b. a -> Either a b
Left (AsyncException -> f AsyncException
forall (f :: * -> *) a. Applicative f => a -> f a
pure AsyncException
t)
{-# INLINE _UserInterrupt #-}
#if __GLASGOW_HASKELL__ >= 710
pattern $bUserInterrupt_ :: s
$mUserInterrupt_ :: forall r s.
AsAsyncException s =>
s -> (Void# -> r) -> (Void# -> r) -> r
UserInterrupt_ <- (has _UserInterrupt -> True) where
UserInterrupt_ = AReview s () -> () -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s ()
forall t. AsAsyncException t => Prism' t ()
_UserInterrupt ()
#endif
class AsNonTermination t where
__NonTermination :: Prism' t NonTermination
_NonTermination :: Prism' t ()
_NonTermination = p NonTermination (f NonTermination) -> p t (f t)
forall t. AsNonTermination t => Prism' t NonTermination
__NonTermination(p NonTermination (f NonTermination) -> p t (f t))
-> (p () (f ()) -> p NonTermination (f NonTermination))
-> p () (f ())
-> p t (f t)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.p () (f ()) -> p NonTermination (f NonTermination)
forall t. AsNonTermination t => Prism' t ()
_NonTermination
{-# INLINE _NonTermination #-}
instance AsNonTermination NonTermination where
__NonTermination :: p NonTermination (f NonTermination)
-> p NonTermination (f NonTermination)
__NonTermination = p NonTermination (f NonTermination)
-> p NonTermination (f NonTermination)
forall a. a -> a
id
{-# INLINE __NonTermination #-}
_NonTermination :: p () (f ()) -> p NonTermination (f NonTermination)
_NonTermination = NonTermination -> Iso' NonTermination ()
forall t. t -> Iso' t ()
trivial NonTermination
NonTermination
{-# INLINE _NonTermination #-}
instance AsNonTermination SomeException where
__NonTermination :: p NonTermination (f NonTermination)
-> p SomeException (f SomeException)
__NonTermination = p NonTermination (f NonTermination)
-> p SomeException (f SomeException)
forall a. Exception a => Prism' SomeException a
exception
{-# INLINE __NonTermination #-}
#if __GLASGOW_HASKELL__ >= 710
pattern $bNonTermination__ :: NonTermination -> s
$mNonTermination__ :: forall r s.
AsNonTermination s =>
s -> (NonTermination -> r) -> (Void# -> r) -> r
NonTermination__ e <- (preview __NonTermination -> Just e) where
NonTermination__ NonTermination
e = AReview s NonTermination -> NonTermination -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s NonTermination
forall t. AsNonTermination t => Prism' t NonTermination
__NonTermination NonTermination
e
pattern $bNonTermination_ :: s
$mNonTermination_ :: forall r s.
AsNonTermination s =>
s -> (Void# -> r) -> (Void# -> r) -> r
NonTermination_ <- (has _NonTermination -> True) where
NonTermination_ = AReview s () -> () -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s ()
forall t. AsNonTermination t => Prism' t ()
_NonTermination ()
#endif
class AsNestedAtomically t where
__NestedAtomically :: Prism' t NestedAtomically
_NestedAtomically :: Prism' t ()
_NestedAtomically = p NestedAtomically (f NestedAtomically) -> p t (f t)
forall t. AsNestedAtomically t => Prism' t NestedAtomically
__NestedAtomically(p NestedAtomically (f NestedAtomically) -> p t (f t))
-> (p () (f ()) -> p NestedAtomically (f NestedAtomically))
-> p () (f ())
-> p t (f t)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.p () (f ()) -> p NestedAtomically (f NestedAtomically)
forall t. AsNestedAtomically t => Prism' t ()
_NestedAtomically
{-# INLINE _NestedAtomically #-}
instance AsNestedAtomically NestedAtomically where
__NestedAtomically :: p NestedAtomically (f NestedAtomically)
-> p NestedAtomically (f NestedAtomically)
__NestedAtomically = p NestedAtomically (f NestedAtomically)
-> p NestedAtomically (f NestedAtomically)
forall a. a -> a
id
{-# INLINE __NestedAtomically #-}
_NestedAtomically :: p () (f ()) -> p NestedAtomically (f NestedAtomically)
_NestedAtomically = NestedAtomically -> Iso' NestedAtomically ()
forall t. t -> Iso' t ()
trivial NestedAtomically
NestedAtomically
{-# INLINE _NestedAtomically #-}
instance AsNestedAtomically SomeException where
__NestedAtomically :: p NestedAtomically (f NestedAtomically)
-> p SomeException (f SomeException)
__NestedAtomically = p NestedAtomically (f NestedAtomically)
-> p SomeException (f SomeException)
forall a. Exception a => Prism' SomeException a
exception
{-# INLINE __NestedAtomically #-}
#if __GLASGOW_HASKELL__ >= 710
pattern $bNestedAtomically__ :: NestedAtomically -> s
$mNestedAtomically__ :: forall r s.
AsNestedAtomically s =>
s -> (NestedAtomically -> r) -> (Void# -> r) -> r
NestedAtomically__ e <- (preview __NestedAtomically -> Just e) where
NestedAtomically__ NestedAtomically
e = AReview s NestedAtomically -> NestedAtomically -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s NestedAtomically
forall t. AsNestedAtomically t => Prism' t NestedAtomically
__NestedAtomically NestedAtomically
e
pattern $bNestedAtomically_ :: s
$mNestedAtomically_ :: forall r s.
AsNestedAtomically s =>
s -> (Void# -> r) -> (Void# -> r) -> r
NestedAtomically_ <- (has _NestedAtomically -> True) where
NestedAtomically_ = AReview s () -> () -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s ()
forall t. AsNestedAtomically t => Prism' t ()
_NestedAtomically ()
#endif
class AsBlockedIndefinitelyOnMVar t where
__BlockedIndefinitelyOnMVar :: Prism' t BlockedIndefinitelyOnMVar
_BlockedIndefinitelyOnMVar :: Prism' t ()
_BlockedIndefinitelyOnMVar = p BlockedIndefinitelyOnMVar (f BlockedIndefinitelyOnMVar)
-> p t (f t)
forall t.
AsBlockedIndefinitelyOnMVar t =>
Prism' t BlockedIndefinitelyOnMVar
__BlockedIndefinitelyOnMVar(p BlockedIndefinitelyOnMVar (f BlockedIndefinitelyOnMVar)
-> p t (f t))
-> (p () (f ())
-> p BlockedIndefinitelyOnMVar (f BlockedIndefinitelyOnMVar))
-> p () (f ())
-> p t (f t)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.p () (f ())
-> p BlockedIndefinitelyOnMVar (f BlockedIndefinitelyOnMVar)
forall t. AsBlockedIndefinitelyOnMVar t => Prism' t ()
_BlockedIndefinitelyOnMVar
{-# INLINE _BlockedIndefinitelyOnMVar #-}
instance AsBlockedIndefinitelyOnMVar BlockedIndefinitelyOnMVar where
__BlockedIndefinitelyOnMVar :: p BlockedIndefinitelyOnMVar (f BlockedIndefinitelyOnMVar)
-> p BlockedIndefinitelyOnMVar (f BlockedIndefinitelyOnMVar)
__BlockedIndefinitelyOnMVar = p BlockedIndefinitelyOnMVar (f BlockedIndefinitelyOnMVar)
-> p BlockedIndefinitelyOnMVar (f BlockedIndefinitelyOnMVar)
forall a. a -> a
id
{-# INLINE __BlockedIndefinitelyOnMVar #-}
_BlockedIndefinitelyOnMVar :: p () (f ())
-> p BlockedIndefinitelyOnMVar (f BlockedIndefinitelyOnMVar)
_BlockedIndefinitelyOnMVar = BlockedIndefinitelyOnMVar -> Iso' BlockedIndefinitelyOnMVar ()
forall t. t -> Iso' t ()
trivial BlockedIndefinitelyOnMVar
BlockedIndefinitelyOnMVar
{-# INLINE _BlockedIndefinitelyOnMVar #-}
instance AsBlockedIndefinitelyOnMVar SomeException where
__BlockedIndefinitelyOnMVar :: p BlockedIndefinitelyOnMVar (f BlockedIndefinitelyOnMVar)
-> p SomeException (f SomeException)
__BlockedIndefinitelyOnMVar = p BlockedIndefinitelyOnMVar (f BlockedIndefinitelyOnMVar)
-> p SomeException (f SomeException)
forall a. Exception a => Prism' SomeException a
exception
{-# INLINE __BlockedIndefinitelyOnMVar #-}
#if __GLASGOW_HASKELL__ >= 710
pattern $bBlockedIndefinitelyOnMVar__ :: BlockedIndefinitelyOnMVar -> s
$mBlockedIndefinitelyOnMVar__ :: forall r s.
AsBlockedIndefinitelyOnMVar s =>
s -> (BlockedIndefinitelyOnMVar -> r) -> (Void# -> r) -> r
BlockedIndefinitelyOnMVar__ e <- (preview __BlockedIndefinitelyOnMVar -> Just e) where
BlockedIndefinitelyOnMVar__ BlockedIndefinitelyOnMVar
e = AReview s BlockedIndefinitelyOnMVar
-> BlockedIndefinitelyOnMVar -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s BlockedIndefinitelyOnMVar
forall t.
AsBlockedIndefinitelyOnMVar t =>
Prism' t BlockedIndefinitelyOnMVar
__BlockedIndefinitelyOnMVar BlockedIndefinitelyOnMVar
e
pattern $bBlockedIndefinitelyOnMVar_ :: s
$mBlockedIndefinitelyOnMVar_ :: forall r s.
AsBlockedIndefinitelyOnMVar s =>
s -> (Void# -> r) -> (Void# -> r) -> r
BlockedIndefinitelyOnMVar_ <- (has _BlockedIndefinitelyOnMVar -> True) where
BlockedIndefinitelyOnMVar_ = AReview s () -> () -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s ()
forall t. AsBlockedIndefinitelyOnMVar t => Prism' t ()
_BlockedIndefinitelyOnMVar ()
#endif
class AsBlockedIndefinitelyOnSTM t where
__BlockedIndefinitelyOnSTM :: Prism' t BlockedIndefinitelyOnSTM
_BlockedIndefinitelyOnSTM :: Prism' t ()
_BlockedIndefinitelyOnSTM = p BlockedIndefinitelyOnSTM (f BlockedIndefinitelyOnSTM)
-> p t (f t)
forall t.
AsBlockedIndefinitelyOnSTM t =>
Prism' t BlockedIndefinitelyOnSTM
__BlockedIndefinitelyOnSTM(p BlockedIndefinitelyOnSTM (f BlockedIndefinitelyOnSTM)
-> p t (f t))
-> (p () (f ())
-> p BlockedIndefinitelyOnSTM (f BlockedIndefinitelyOnSTM))
-> p () (f ())
-> p t (f t)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.p () (f ())
-> p BlockedIndefinitelyOnSTM (f BlockedIndefinitelyOnSTM)
forall t. AsBlockedIndefinitelyOnSTM t => Prism' t ()
_BlockedIndefinitelyOnSTM
{-# INLINE _BlockedIndefinitelyOnSTM #-}
instance AsBlockedIndefinitelyOnSTM BlockedIndefinitelyOnSTM where
__BlockedIndefinitelyOnSTM :: p BlockedIndefinitelyOnSTM (f BlockedIndefinitelyOnSTM)
-> p BlockedIndefinitelyOnSTM (f BlockedIndefinitelyOnSTM)
__BlockedIndefinitelyOnSTM = p BlockedIndefinitelyOnSTM (f BlockedIndefinitelyOnSTM)
-> p BlockedIndefinitelyOnSTM (f BlockedIndefinitelyOnSTM)
forall a. a -> a
id
{-# INLINE __BlockedIndefinitelyOnSTM #-}
_BlockedIndefinitelyOnSTM :: p () (f ())
-> p BlockedIndefinitelyOnSTM (f BlockedIndefinitelyOnSTM)
_BlockedIndefinitelyOnSTM = BlockedIndefinitelyOnSTM -> Iso' BlockedIndefinitelyOnSTM ()
forall t. t -> Iso' t ()
trivial BlockedIndefinitelyOnSTM
BlockedIndefinitelyOnSTM
{-# INLINE _BlockedIndefinitelyOnSTM #-}
instance AsBlockedIndefinitelyOnSTM SomeException where
__BlockedIndefinitelyOnSTM :: p BlockedIndefinitelyOnSTM (f BlockedIndefinitelyOnSTM)
-> p SomeException (f SomeException)
__BlockedIndefinitelyOnSTM = p BlockedIndefinitelyOnSTM (f BlockedIndefinitelyOnSTM)
-> p SomeException (f SomeException)
forall a. Exception a => Prism' SomeException a
exception
{-# INLINE __BlockedIndefinitelyOnSTM #-}
#if __GLASGOW_HASKELL__ >= 710
pattern $bBlockedIndefinitelyOnSTM__ :: BlockedIndefinitelyOnSTM -> s
$mBlockedIndefinitelyOnSTM__ :: forall r s.
AsBlockedIndefinitelyOnSTM s =>
s -> (BlockedIndefinitelyOnSTM -> r) -> (Void# -> r) -> r
BlockedIndefinitelyOnSTM__ e <- (preview __BlockedIndefinitelyOnSTM -> Just e) where
BlockedIndefinitelyOnSTM__ BlockedIndefinitelyOnSTM
e = AReview s BlockedIndefinitelyOnSTM -> BlockedIndefinitelyOnSTM -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s BlockedIndefinitelyOnSTM
forall t.
AsBlockedIndefinitelyOnSTM t =>
Prism' t BlockedIndefinitelyOnSTM
__BlockedIndefinitelyOnSTM BlockedIndefinitelyOnSTM
e
pattern $bBlockedIndefinitelyOnSTM_ :: s
$mBlockedIndefinitelyOnSTM_ :: forall r s.
AsBlockedIndefinitelyOnSTM s =>
s -> (Void# -> r) -> (Void# -> r) -> r
BlockedIndefinitelyOnSTM_ <- (has _BlockedIndefinitelyOnSTM -> True) where
BlockedIndefinitelyOnSTM_ = AReview s () -> () -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s ()
forall t. AsBlockedIndefinitelyOnSTM t => Prism' t ()
_BlockedIndefinitelyOnSTM ()
#endif
class AsDeadlock t where
__Deadlock :: Prism' t Deadlock
_Deadlock :: Prism' t ()
_Deadlock = p Deadlock (f Deadlock) -> p t (f t)
forall t. AsDeadlock t => Prism' t Deadlock
__Deadlock(p Deadlock (f Deadlock) -> p t (f t))
-> (p () (f ()) -> p Deadlock (f Deadlock))
-> p () (f ())
-> p t (f t)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.p () (f ()) -> p Deadlock (f Deadlock)
forall t. AsDeadlock t => Prism' t ()
_Deadlock
{-# INLINE _Deadlock #-}
instance AsDeadlock Deadlock where
__Deadlock :: p Deadlock (f Deadlock) -> p Deadlock (f Deadlock)
__Deadlock = p Deadlock (f Deadlock) -> p Deadlock (f Deadlock)
forall a. a -> a
id
{-# INLINE __Deadlock #-}
_Deadlock :: p () (f ()) -> p Deadlock (f Deadlock)
_Deadlock = Deadlock -> Iso' Deadlock ()
forall t. t -> Iso' t ()
trivial Deadlock
Deadlock
{-# INLINE _Deadlock #-}
instance AsDeadlock SomeException where
__Deadlock :: p Deadlock (f Deadlock) -> p SomeException (f SomeException)
__Deadlock = p Deadlock (f Deadlock) -> p SomeException (f SomeException)
forall a. Exception a => Prism' SomeException a
exception
{-# INLINE __Deadlock #-}
#if __GLASGOW_HASKELL__ >= 710
pattern $bDeadlock__ :: Deadlock -> s
$mDeadlock__ :: forall r s.
AsDeadlock s =>
s -> (Deadlock -> r) -> (Void# -> r) -> r
Deadlock__ e <- (preview __Deadlock -> Just e) where
Deadlock__ Deadlock
e = AReview s Deadlock -> Deadlock -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s Deadlock
forall t. AsDeadlock t => Prism' t Deadlock
__Deadlock Deadlock
e
pattern $bDeadlock_ :: s
$mDeadlock_ :: forall r s. AsDeadlock s => s -> (Void# -> r) -> (Void# -> r) -> r
Deadlock_ <- (has _Deadlock -> True) where
Deadlock_ = AReview s () -> () -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s ()
forall t. AsDeadlock t => Prism' t ()
_Deadlock ()
#endif
class AsNoMethodError t where
__NoMethodError :: Prism' t NoMethodError
_NoMethodError :: Prism' t String
_NoMethodError = p NoMethodError (f NoMethodError) -> p t (f t)
forall t. AsNoMethodError t => Prism' t NoMethodError
__NoMethodError(p NoMethodError (f NoMethodError) -> p t (f t))
-> (p String (f String) -> p NoMethodError (f NoMethodError))
-> p String (f String)
-> p t (f t)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.p String (f String) -> p NoMethodError (f NoMethodError)
forall t. AsNoMethodError t => Prism' t String
_NoMethodError
{-# INLINE _NoMethodError #-}
instance AsNoMethodError NoMethodError where
__NoMethodError :: p NoMethodError (f NoMethodError)
-> p NoMethodError (f NoMethodError)
__NoMethodError = p NoMethodError (f NoMethodError)
-> p NoMethodError (f NoMethodError)
forall a. a -> a
id
{-# INLINE __NoMethodError #-}
_NoMethodError :: p String (f String) -> p NoMethodError (f NoMethodError)
_NoMethodError = (Unwrapped NoMethodError -> NoMethodError)
-> Iso
NoMethodError
NoMethodError
(Unwrapped NoMethodError)
(Unwrapped NoMethodError)
forall s t.
Rewrapping s t =>
(Unwrapped s -> s) -> Iso s t (Unwrapped s) (Unwrapped t)
_Wrapping String -> NoMethodError
Unwrapped NoMethodError -> NoMethodError
NoMethodError
{-# INLINE _NoMethodError #-}
instance AsNoMethodError SomeException where
__NoMethodError :: p NoMethodError (f NoMethodError)
-> p SomeException (f SomeException)
__NoMethodError = p NoMethodError (f NoMethodError)
-> p SomeException (f SomeException)
forall a. Exception a => Prism' SomeException a
exception
{-# INLINE __NoMethodError #-}
#if __GLASGOW_HASKELL__ >= 710
pattern $bNoMethodError__ :: NoMethodError -> s
$mNoMethodError__ :: forall r s.
AsNoMethodError s =>
s -> (NoMethodError -> r) -> (Void# -> r) -> r
NoMethodError__ e <- (preview __NoMethodError -> Just e) where
NoMethodError__ NoMethodError
e = AReview s NoMethodError -> NoMethodError -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s NoMethodError
forall t. AsNoMethodError t => Prism' t NoMethodError
__NoMethodError NoMethodError
e
pattern $bNoMethodError_ :: String -> s
$mNoMethodError_ :: forall r s.
AsNoMethodError s =>
s -> (String -> r) -> (Void# -> r) -> r
NoMethodError_ e <- (preview _NoMethodError -> Just e) where
NoMethodError_ String
e = AReview s String -> String -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s String
forall t. AsNoMethodError t => Prism' t String
_NoMethodError String
e
#endif
class AsPatternMatchFail t where
__PatternMatchFail :: Prism' t PatternMatchFail
_PatternMatchFail :: Prism' t String
_PatternMatchFail = p PatternMatchFail (f PatternMatchFail) -> p t (f t)
forall t. AsPatternMatchFail t => Prism' t PatternMatchFail
__PatternMatchFail(p PatternMatchFail (f PatternMatchFail) -> p t (f t))
-> (p String (f String) -> p PatternMatchFail (f PatternMatchFail))
-> p String (f String)
-> p t (f t)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.p String (f String) -> p PatternMatchFail (f PatternMatchFail)
forall t. AsPatternMatchFail t => Prism' t String
_PatternMatchFail
{-# INLINE _PatternMatchFail #-}
instance AsPatternMatchFail PatternMatchFail where
__PatternMatchFail :: p PatternMatchFail (f PatternMatchFail)
-> p PatternMatchFail (f PatternMatchFail)
__PatternMatchFail = p PatternMatchFail (f PatternMatchFail)
-> p PatternMatchFail (f PatternMatchFail)
forall a. a -> a
id
{-# INLINE __PatternMatchFail #-}
_PatternMatchFail :: p String (f String) -> p PatternMatchFail (f PatternMatchFail)
_PatternMatchFail = (Unwrapped PatternMatchFail -> PatternMatchFail)
-> Iso
PatternMatchFail
PatternMatchFail
(Unwrapped PatternMatchFail)
(Unwrapped PatternMatchFail)
forall s t.
Rewrapping s t =>
(Unwrapped s -> s) -> Iso s t (Unwrapped s) (Unwrapped t)
_Wrapping String -> PatternMatchFail
Unwrapped PatternMatchFail -> PatternMatchFail
PatternMatchFail
{-# INLINE _PatternMatchFail #-}
instance AsPatternMatchFail SomeException where
__PatternMatchFail :: p PatternMatchFail (f PatternMatchFail)
-> p SomeException (f SomeException)
__PatternMatchFail = p PatternMatchFail (f PatternMatchFail)
-> p SomeException (f SomeException)
forall a. Exception a => Prism' SomeException a
exception
{-# INLINE __PatternMatchFail #-}
#if __GLASGOW_HASKELL__ >= 710
pattern $bPatternMatchFail__ :: PatternMatchFail -> s
$mPatternMatchFail__ :: forall r s.
AsPatternMatchFail s =>
s -> (PatternMatchFail -> r) -> (Void# -> r) -> r
PatternMatchFail__ e <- (preview __PatternMatchFail -> Just e) where
PatternMatchFail__ PatternMatchFail
e = AReview s PatternMatchFail -> PatternMatchFail -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s PatternMatchFail
forall t. AsPatternMatchFail t => Prism' t PatternMatchFail
__PatternMatchFail PatternMatchFail
e
pattern $bPatternMatchFail_ :: String -> s
$mPatternMatchFail_ :: forall r s.
AsPatternMatchFail s =>
s -> (String -> r) -> (Void# -> r) -> r
PatternMatchFail_ e <- (preview _PatternMatchFail -> Just e) where
PatternMatchFail_ String
e = AReview s String -> String -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s String
forall t. AsPatternMatchFail t => Prism' t String
_PatternMatchFail String
e
#endif
class AsRecConError t where
__RecConError :: Prism' t RecConError
_RecConError :: Prism' t String
_RecConError = p RecConError (f RecConError) -> p t (f t)
forall t. AsRecConError t => Prism' t RecConError
__RecConError(p RecConError (f RecConError) -> p t (f t))
-> (p String (f String) -> p RecConError (f RecConError))
-> p String (f String)
-> p t (f t)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.p String (f String) -> p RecConError (f RecConError)
forall t. AsRecConError t => Prism' t String
_RecConError
{-# INLINE _RecConError #-}
instance AsRecConError RecConError where
__RecConError :: p RecConError (f RecConError) -> p RecConError (f RecConError)
__RecConError = p RecConError (f RecConError) -> p RecConError (f RecConError)
forall a. a -> a
id
{-# INLINE __RecConError #-}
_RecConError :: p String (f String) -> p RecConError (f RecConError)
_RecConError = (Unwrapped RecConError -> RecConError)
-> Iso
RecConError
RecConError
(Unwrapped RecConError)
(Unwrapped RecConError)
forall s t.
Rewrapping s t =>
(Unwrapped s -> s) -> Iso s t (Unwrapped s) (Unwrapped t)
_Wrapping String -> RecConError
Unwrapped RecConError -> RecConError
RecConError
{-# INLINE _RecConError #-}
instance AsRecConError SomeException where
__RecConError :: p RecConError (f RecConError) -> p SomeException (f SomeException)
__RecConError = p RecConError (f RecConError) -> p SomeException (f SomeException)
forall a. Exception a => Prism' SomeException a
exception
{-# INLINE __RecConError #-}
#if __GLASGOW_HASKELL__ >= 710
pattern $bRecConError__ :: RecConError -> s
$mRecConError__ :: forall r s.
AsRecConError s =>
s -> (RecConError -> r) -> (Void# -> r) -> r
RecConError__ e <- (preview __RecConError -> Just e) where
RecConError__ RecConError
e = AReview s RecConError -> RecConError -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s RecConError
forall t. AsRecConError t => Prism' t RecConError
__RecConError RecConError
e
pattern $bRecConError_ :: String -> s
$mRecConError_ :: forall r s.
AsRecConError s =>
s -> (String -> r) -> (Void# -> r) -> r
RecConError_ e <- (preview _RecConError -> Just e) where
RecConError_ String
e = AReview s String -> String -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s String
forall t. AsRecConError t => Prism' t String
_RecConError String
e
#endif
class AsRecSelError t where
__RecSelError :: Prism' t RecSelError
_RecSelError :: Prism' t String
_RecSelError = p RecSelError (f RecSelError) -> p t (f t)
forall t. AsRecSelError t => Prism' t RecSelError
__RecSelError(p RecSelError (f RecSelError) -> p t (f t))
-> (p String (f String) -> p RecSelError (f RecSelError))
-> p String (f String)
-> p t (f t)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.p String (f String) -> p RecSelError (f RecSelError)
forall t. AsRecSelError t => Prism' t String
_RecSelError
{-# INLINE _RecSelError #-}
instance AsRecSelError RecSelError where
__RecSelError :: p RecSelError (f RecSelError) -> p RecSelError (f RecSelError)
__RecSelError = p RecSelError (f RecSelError) -> p RecSelError (f RecSelError)
forall a. a -> a
id
{-# INLINE __RecSelError #-}
_RecSelError :: p String (f String) -> p RecSelError (f RecSelError)
_RecSelError = (Unwrapped RecSelError -> RecSelError)
-> Iso
RecSelError
RecSelError
(Unwrapped RecSelError)
(Unwrapped RecSelError)
forall s t.
Rewrapping s t =>
(Unwrapped s -> s) -> Iso s t (Unwrapped s) (Unwrapped t)
_Wrapping String -> RecSelError
Unwrapped RecSelError -> RecSelError
RecSelError
{-# INLINE _RecSelError #-}
instance AsRecSelError SomeException where
__RecSelError :: p RecSelError (f RecSelError) -> p SomeException (f SomeException)
__RecSelError = p RecSelError (f RecSelError) -> p SomeException (f SomeException)
forall a. Exception a => Prism' SomeException a
exception
{-# INLINE __RecSelError #-}
#if __GLASGOW_HASKELL__ >= 710
pattern $bRecSelError__ :: RecSelError -> s
$mRecSelError__ :: forall r s.
AsRecSelError s =>
s -> (RecSelError -> r) -> (Void# -> r) -> r
RecSelError__ e <- (preview __RecSelError -> Just e) where
RecSelError__ RecSelError
e = AReview s RecSelError -> RecSelError -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s RecSelError
forall t. AsRecSelError t => Prism' t RecSelError
__RecSelError RecSelError
e
pattern $bRecSelError_ :: String -> s
$mRecSelError_ :: forall r s.
AsRecSelError s =>
s -> (String -> r) -> (Void# -> r) -> r
RecSelError_ e <- (preview _RecSelError -> Just e) where
RecSelError_ String
e = AReview s String -> String -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s String
forall t. AsRecSelError t => Prism' t String
_RecSelError String
e
#endif
class AsRecUpdError t where
__RecUpdError :: Prism' t RecUpdError
_RecUpdError :: Prism' t String
_RecUpdError = p RecUpdError (f RecUpdError) -> p t (f t)
forall t. AsRecUpdError t => Prism' t RecUpdError
__RecUpdError(p RecUpdError (f RecUpdError) -> p t (f t))
-> (p String (f String) -> p RecUpdError (f RecUpdError))
-> p String (f String)
-> p t (f t)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.p String (f String) -> p RecUpdError (f RecUpdError)
forall t. AsRecUpdError t => Prism' t String
_RecUpdError
{-# INLINE _RecUpdError #-}
instance AsRecUpdError RecUpdError where
__RecUpdError :: p RecUpdError (f RecUpdError) -> p RecUpdError (f RecUpdError)
__RecUpdError = p RecUpdError (f RecUpdError) -> p RecUpdError (f RecUpdError)
forall a. a -> a
id
{-# INLINE __RecUpdError #-}
_RecUpdError :: p String (f String) -> p RecUpdError (f RecUpdError)
_RecUpdError = (Unwrapped RecUpdError -> RecUpdError)
-> Iso
RecUpdError
RecUpdError
(Unwrapped RecUpdError)
(Unwrapped RecUpdError)
forall s t.
Rewrapping s t =>
(Unwrapped s -> s) -> Iso s t (Unwrapped s) (Unwrapped t)
_Wrapping String -> RecUpdError
Unwrapped RecUpdError -> RecUpdError
RecUpdError
{-# INLINE _RecUpdError #-}
instance AsRecUpdError SomeException where
__RecUpdError :: p RecUpdError (f RecUpdError) -> p SomeException (f SomeException)
__RecUpdError = p RecUpdError (f RecUpdError) -> p SomeException (f SomeException)
forall a. Exception a => Prism' SomeException a
exception
{-# INLINE __RecUpdError #-}
#if __GLASGOW_HASKELL__ >= 710
pattern $bRecUpdError__ :: RecUpdError -> s
$mRecUpdError__ :: forall r s.
AsRecUpdError s =>
s -> (RecUpdError -> r) -> (Void# -> r) -> r
RecUpdError__ e <- (preview __RecUpdError -> Just e) where
RecUpdError__ RecUpdError
e = AReview s RecUpdError -> RecUpdError -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s RecUpdError
forall t. AsRecUpdError t => Prism' t RecUpdError
__RecUpdError RecUpdError
e
pattern $bRecUpdError_ :: String -> s
$mRecUpdError_ :: forall r s.
AsRecUpdError s =>
s -> (String -> r) -> (Void# -> r) -> r
RecUpdError_ e <- (preview _RecUpdError -> Just e) where
RecUpdError_ String
e = AReview s String -> String -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s String
forall t. AsRecUpdError t => Prism' t String
_RecUpdError String
e
#endif
class AsErrorCall t where
__ErrorCall :: Prism' t ErrorCall
_ErrorCall :: Prism' t String
_ErrorCall = p ErrorCall (f ErrorCall) -> p t (f t)
forall t. AsErrorCall t => Prism' t ErrorCall
__ErrorCall(p ErrorCall (f ErrorCall) -> p t (f t))
-> (p String (f String) -> p ErrorCall (f ErrorCall))
-> p String (f String)
-> p t (f t)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.p String (f String) -> p ErrorCall (f ErrorCall)
forall t. AsErrorCall t => Prism' t String
_ErrorCall
{-# INLINE _ErrorCall #-}
instance AsErrorCall ErrorCall where
__ErrorCall :: p ErrorCall (f ErrorCall) -> p ErrorCall (f ErrorCall)
__ErrorCall = p ErrorCall (f ErrorCall) -> p ErrorCall (f ErrorCall)
forall a. a -> a
id
{-# INLINE __ErrorCall #-}
_ErrorCall :: p String (f String) -> p ErrorCall (f ErrorCall)
_ErrorCall = (Unwrapped ErrorCall -> ErrorCall)
-> Iso
ErrorCall ErrorCall (Unwrapped ErrorCall) (Unwrapped ErrorCall)
forall s t.
Rewrapping s t =>
(Unwrapped s -> s) -> Iso s t (Unwrapped s) (Unwrapped t)
_Wrapping String -> ErrorCall
Unwrapped ErrorCall -> ErrorCall
ErrorCall
{-# INLINE _ErrorCall #-}
instance AsErrorCall SomeException where
__ErrorCall :: p ErrorCall (f ErrorCall) -> p SomeException (f SomeException)
__ErrorCall = p ErrorCall (f ErrorCall) -> p SomeException (f SomeException)
forall a. Exception a => Prism' SomeException a
exception
{-# INLINE __ErrorCall #-}
#if __GLASGOW_HASKELL__ >= 710
pattern $bErrorCall__ :: ErrorCall -> s
$mErrorCall__ :: forall r s.
AsErrorCall s =>
s -> (ErrorCall -> r) -> (Void# -> r) -> r
ErrorCall__ e <- (preview __ErrorCall -> Just e) where
ErrorCall__ ErrorCall
e = AReview s ErrorCall -> ErrorCall -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s ErrorCall
forall t. AsErrorCall t => Prism' t ErrorCall
__ErrorCall ErrorCall
e
pattern $bErrorCall_ :: String -> s
$mErrorCall_ :: forall r s.
AsErrorCall s =>
s -> (String -> r) -> (Void# -> r) -> r
ErrorCall_ e <- (preview _ErrorCall -> Just e) where
ErrorCall_ String
e = AReview s String -> String -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s String
forall t. AsErrorCall t => Prism' t String
_ErrorCall String
e
#endif
#if MIN_VERSION_base(4,8,0)
class AsAllocationLimitExceeded t where
__AllocationLimitExceeded :: Prism' t AllocationLimitExceeded
_AllocationLimitExceeded :: Prism' t ()
_AllocationLimitExceeded = p AllocationLimitExceeded (f AllocationLimitExceeded) -> p t (f t)
forall t.
AsAllocationLimitExceeded t =>
Prism' t AllocationLimitExceeded
__AllocationLimitExceeded(p AllocationLimitExceeded (f AllocationLimitExceeded)
-> p t (f t))
-> (p () (f ())
-> p AllocationLimitExceeded (f AllocationLimitExceeded))
-> p () (f ())
-> p t (f t)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.p () (f ())
-> p AllocationLimitExceeded (f AllocationLimitExceeded)
forall t. AsAllocationLimitExceeded t => Prism' t ()
_AllocationLimitExceeded
{-# INLINE _AllocationLimitExceeded #-}
instance AsAllocationLimitExceeded AllocationLimitExceeded where
__AllocationLimitExceeded :: p AllocationLimitExceeded (f AllocationLimitExceeded)
-> p AllocationLimitExceeded (f AllocationLimitExceeded)
__AllocationLimitExceeded = p AllocationLimitExceeded (f AllocationLimitExceeded)
-> p AllocationLimitExceeded (f AllocationLimitExceeded)
forall a. a -> a
id
{-# INLINE __AllocationLimitExceeded #-}
_AllocationLimitExceeded :: p () (f ())
-> p AllocationLimitExceeded (f AllocationLimitExceeded)
_AllocationLimitExceeded = AllocationLimitExceeded -> Iso' AllocationLimitExceeded ()
forall t. t -> Iso' t ()
trivial AllocationLimitExceeded
AllocationLimitExceeded
{-# INLINE _AllocationLimitExceeded #-}
instance AsAllocationLimitExceeded SomeException where
__AllocationLimitExceeded :: p AllocationLimitExceeded (f AllocationLimitExceeded)
-> p SomeException (f SomeException)
__AllocationLimitExceeded = p AllocationLimitExceeded (f AllocationLimitExceeded)
-> p SomeException (f SomeException)
forall a. Exception a => Prism' SomeException a
exception
{-# INLINE __AllocationLimitExceeded #-}
pattern $bAllocationLimitExceeded__ :: AllocationLimitExceeded -> s
$mAllocationLimitExceeded__ :: forall r s.
AsAllocationLimitExceeded s =>
s -> (AllocationLimitExceeded -> r) -> (Void# -> r) -> r
AllocationLimitExceeded__ e <- (preview __AllocationLimitExceeded -> Just e) where
AllocationLimitExceeded__ AllocationLimitExceeded
e = AReview s AllocationLimitExceeded -> AllocationLimitExceeded -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s AllocationLimitExceeded
forall t.
AsAllocationLimitExceeded t =>
Prism' t AllocationLimitExceeded
__AllocationLimitExceeded AllocationLimitExceeded
e
pattern $bAllocationLimitExceeded_ :: s
$mAllocationLimitExceeded_ :: forall r s.
AsAllocationLimitExceeded s =>
s -> (Void# -> r) -> (Void# -> r) -> r
AllocationLimitExceeded_ <- (has _AllocationLimitExceeded -> True) where
AllocationLimitExceeded_ = AReview s () -> () -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s ()
forall t. AsAllocationLimitExceeded t => Prism' t ()
_AllocationLimitExceeded ()
#endif
#if MIN_VERSION_base(4,9,0)
class AsTypeError t where
__TypeError :: Prism' t TypeError
_TypeError :: Prism' t String
_TypeError = p TypeError (f TypeError) -> p t (f t)
forall t. AsTypeError t => Prism' t TypeError
__TypeError(p TypeError (f TypeError) -> p t (f t))
-> (p String (f String) -> p TypeError (f TypeError))
-> p String (f String)
-> p t (f t)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.p String (f String) -> p TypeError (f TypeError)
forall t. AsTypeError t => Prism' t String
_TypeError
{-# INLINE _TypeError #-}
instance AsTypeError TypeError where
__TypeError :: p TypeError (f TypeError) -> p TypeError (f TypeError)
__TypeError = p TypeError (f TypeError) -> p TypeError (f TypeError)
forall a. a -> a
id
{-# INLINE __TypeError #-}
_TypeError :: p String (f String) -> p TypeError (f TypeError)
_TypeError = (Unwrapped TypeError -> TypeError)
-> Iso
TypeError TypeError (Unwrapped TypeError) (Unwrapped TypeError)
forall s t.
Rewrapping s t =>
(Unwrapped s -> s) -> Iso s t (Unwrapped s) (Unwrapped t)
_Wrapping String -> TypeError
Unwrapped TypeError -> TypeError
TypeError
{-# INLINE _TypeError #-}
instance AsTypeError SomeException where
__TypeError :: p TypeError (f TypeError) -> p SomeException (f SomeException)
__TypeError = p TypeError (f TypeError) -> p SomeException (f SomeException)
forall a. Exception a => Prism' SomeException a
exception
{-# INLINE __TypeError #-}
pattern $bTypeError__ :: TypeError -> s
$mTypeError__ :: forall r s.
AsTypeError s =>
s -> (TypeError -> r) -> (Void# -> r) -> r
TypeError__ e <- (preview __TypeError -> Just e) where
TypeError__ TypeError
e = AReview s TypeError -> TypeError -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s TypeError
forall t. AsTypeError t => Prism' t TypeError
__TypeError TypeError
e
pattern $bTypeError_ :: String -> s
$mTypeError_ :: forall r s.
AsTypeError s =>
s -> (String -> r) -> (Void# -> r) -> r
TypeError_ e <- (preview _TypeError -> Just e) where
TypeError_ String
e = AReview s String -> String -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s String
forall t. AsTypeError t => Prism' t String
_TypeError String
e
#endif
#if MIN_VERSION_base(4,10,0)
class AsCompactionFailed t where
__CompactionFailed :: Prism' t CompactionFailed
_CompactionFailed :: Prism' t String
_CompactionFailed = p CompactionFailed (f CompactionFailed) -> p t (f t)
forall t. AsCompactionFailed t => Prism' t CompactionFailed
__CompactionFailed(p CompactionFailed (f CompactionFailed) -> p t (f t))
-> (p String (f String) -> p CompactionFailed (f CompactionFailed))
-> p String (f String)
-> p t (f t)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.p String (f String) -> p CompactionFailed (f CompactionFailed)
forall t. AsCompactionFailed t => Prism' t String
_CompactionFailed
{-# INLINE _CompactionFailed #-}
instance AsCompactionFailed CompactionFailed where
__CompactionFailed :: p CompactionFailed (f CompactionFailed)
-> p CompactionFailed (f CompactionFailed)
__CompactionFailed = p CompactionFailed (f CompactionFailed)
-> p CompactionFailed (f CompactionFailed)
forall a. a -> a
id
{-# INLINE __CompactionFailed #-}
_CompactionFailed :: p String (f String) -> p CompactionFailed (f CompactionFailed)
_CompactionFailed = (Unwrapped CompactionFailed -> CompactionFailed)
-> Iso
CompactionFailed
CompactionFailed
(Unwrapped CompactionFailed)
(Unwrapped CompactionFailed)
forall s t.
Rewrapping s t =>
(Unwrapped s -> s) -> Iso s t (Unwrapped s) (Unwrapped t)
_Wrapping String -> CompactionFailed
Unwrapped CompactionFailed -> CompactionFailed
CompactionFailed
{-# INLINE _CompactionFailed #-}
instance AsCompactionFailed SomeException where
__CompactionFailed :: p CompactionFailed (f CompactionFailed)
-> p SomeException (f SomeException)
__CompactionFailed = p CompactionFailed (f CompactionFailed)
-> p SomeException (f SomeException)
forall a. Exception a => Prism' SomeException a
exception
{-# INLINE __CompactionFailed #-}
pattern $bCompactionFailed__ :: CompactionFailed -> s
$mCompactionFailed__ :: forall r s.
AsCompactionFailed s =>
s -> (CompactionFailed -> r) -> (Void# -> r) -> r
CompactionFailed__ e <- (preview __CompactionFailed -> Just e) where
CompactionFailed__ CompactionFailed
e = AReview s CompactionFailed -> CompactionFailed -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s CompactionFailed
forall t. AsCompactionFailed t => Prism' t CompactionFailed
__CompactionFailed CompactionFailed
e
pattern $bCompactionFailed_ :: String -> s
$mCompactionFailed_ :: forall r s.
AsCompactionFailed s =>
s -> (String -> r) -> (Void# -> r) -> r
CompactionFailed_ e <- (preview _CompactionFailed -> Just e) where
CompactionFailed_ String
e = AReview s String -> String -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s String
forall t. AsCompactionFailed t => Prism' t String
_CompactionFailed String
e
#endif
class AsHandlingException t where
__HandlingException :: Prism' t HandlingException
_HandlingException :: Prism' t ()
_HandlingException = p HandlingException (f HandlingException) -> p t (f t)
forall t. AsHandlingException t => Prism' t HandlingException
__HandlingException(p HandlingException (f HandlingException) -> p t (f t))
-> (p () (f ()) -> p HandlingException (f HandlingException))
-> p () (f ())
-> p t (f t)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.p () (f ()) -> p HandlingException (f HandlingException)
forall t. AsHandlingException t => Prism' t ()
_HandlingException
{-# INLINE _HandlingException #-}
instance AsHandlingException HandlingException where
__HandlingException :: p HandlingException (f HandlingException)
-> p HandlingException (f HandlingException)
__HandlingException = p HandlingException (f HandlingException)
-> p HandlingException (f HandlingException)
forall a. a -> a
id
{-# INLINE __HandlingException #-}
_HandlingException :: p () (f ()) -> p HandlingException (f HandlingException)
_HandlingException = HandlingException -> Iso' HandlingException ()
forall t. t -> Iso' t ()
trivial HandlingException
HandlingException
{-# INLINE _HandlingException #-}
instance AsHandlingException SomeException where
__HandlingException :: p HandlingException (f HandlingException)
-> p SomeException (f SomeException)
__HandlingException = p HandlingException (f HandlingException)
-> p SomeException (f SomeException)
forall a. Exception a => Prism' SomeException a
exception
{-# INLINE __HandlingException #-}
#if __GLASGOW_HASKELL__ >= 710
pattern $bHandlingException__ :: HandlingException -> s
$mHandlingException__ :: forall r s.
AsHandlingException s =>
s -> (HandlingException -> r) -> (Void# -> r) -> r
HandlingException__ e <- (preview __HandlingException -> Just e) where
HandlingException__ HandlingException
e = AReview s HandlingException -> HandlingException -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s HandlingException
forall t. AsHandlingException t => Prism' t HandlingException
__HandlingException HandlingException
e
pattern $bHandlingException_ :: s
$mHandlingException_ :: forall r s.
AsHandlingException s =>
s -> (Void# -> r) -> (Void# -> r) -> r
HandlingException_ <- (has _HandlingException -> True) where
HandlingException_ = AReview s () -> () -> s
forall b (m :: * -> *) t. MonadReader b m => AReview t b -> m t
review AReview s ()
forall t. AsHandlingException t => Prism' t ()
_HandlingException ()
#endif
trivial :: t -> Iso' t ()
trivial :: t -> Iso' t ()
trivial t
t = () -> t -> ()
forall a b. a -> b -> a
const () (t -> ()) -> (() -> t) -> Iso' t ()
forall s a b t. (s -> a) -> (b -> t) -> Iso s t a b
`iso` t -> () -> t
forall a b. a -> b -> a
const t
t