{-# LANGUAGE DerivingVia #-}
{-# OPTIONS_HADDOCK not-home #-}
module Control.Effect.Internal.Unlift where

import Control.Effect
import Control.Effect.Carrier
import Control.Effect.Carrier.Internal.Interpret

import Control.Effect.Type.Unlift


data UnliftH

instance Carrier m
      => PrimHandler UnliftH (Unlift m) m where
  effPrimHandler :: Unlift m m x -> m x
effPrimHandler (Unlift (forall x. m x -> m x) -> m x
main) = (forall x. m x -> m x) -> m x
main forall a. a -> a
forall x. m x -> m x
id
  {-# INLINEABLE effPrimHandler #-}

newtype UnliftC m a = UnliftC {
    UnliftC m a -> m a
unUnliftC :: m a
  }
  deriving ( a -> UnliftC m b -> UnliftC m a
(a -> b) -> UnliftC m a -> UnliftC m b
(forall a b. (a -> b) -> UnliftC m a -> UnliftC m b)
-> (forall a b. a -> UnliftC m b -> UnliftC m a)
-> Functor (UnliftC m)
forall a b. a -> UnliftC m b -> UnliftC m a
forall a b. (a -> b) -> UnliftC m a -> UnliftC m b
forall (m :: * -> *) a b.
Functor m =>
a -> UnliftC m b -> UnliftC m a
forall (m :: * -> *) a b.
Functor m =>
(a -> b) -> UnliftC m a -> UnliftC m b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> UnliftC m b -> UnliftC m a
$c<$ :: forall (m :: * -> *) a b.
Functor m =>
a -> UnliftC m b -> UnliftC m a
fmap :: (a -> b) -> UnliftC m a -> UnliftC m b
$cfmap :: forall (m :: * -> *) a b.
Functor m =>
(a -> b) -> UnliftC m a -> UnliftC m b
Functor, Functor (UnliftC m)
a -> UnliftC m a
Functor (UnliftC m)
-> (forall a. a -> UnliftC m a)
-> (forall a b. UnliftC m (a -> b) -> UnliftC m a -> UnliftC m b)
-> (forall a b c.
    (a -> b -> c) -> UnliftC m a -> UnliftC m b -> UnliftC m c)
-> (forall a b. UnliftC m a -> UnliftC m b -> UnliftC m b)
-> (forall a b. UnliftC m a -> UnliftC m b -> UnliftC m a)
-> Applicative (UnliftC m)
UnliftC m a -> UnliftC m b -> UnliftC m b
UnliftC m a -> UnliftC m b -> UnliftC m a
UnliftC m (a -> b) -> UnliftC m a -> UnliftC m b
(a -> b -> c) -> UnliftC m a -> UnliftC m b -> UnliftC m c
forall a. a -> UnliftC m a
forall a b. UnliftC m a -> UnliftC m b -> UnliftC m a
forall a b. UnliftC m a -> UnliftC m b -> UnliftC m b
forall a b. UnliftC m (a -> b) -> UnliftC m a -> UnliftC m b
forall a b c.
(a -> b -> c) -> UnliftC m a -> UnliftC m b -> UnliftC m c
forall (f :: * -> *).
Functor f
-> (forall a. a -> f a)
-> (forall a b. f (a -> b) -> f a -> f b)
-> (forall a b c. (a -> b -> c) -> f a -> f b -> f c)
-> (forall a b. f a -> f b -> f b)
-> (forall a b. f a -> f b -> f a)
-> Applicative f
forall (m :: * -> *). Applicative m => Functor (UnliftC m)
forall (m :: * -> *) a. Applicative m => a -> UnliftC m a
forall (m :: * -> *) a b.
Applicative m =>
UnliftC m a -> UnliftC m b -> UnliftC m a
forall (m :: * -> *) a b.
Applicative m =>
UnliftC m a -> UnliftC m b -> UnliftC m b
forall (m :: * -> *) a b.
Applicative m =>
UnliftC m (a -> b) -> UnliftC m a -> UnliftC m b
forall (m :: * -> *) a b c.
Applicative m =>
(a -> b -> c) -> UnliftC m a -> UnliftC m b -> UnliftC m c
<* :: UnliftC m a -> UnliftC m b -> UnliftC m a
$c<* :: forall (m :: * -> *) a b.
Applicative m =>
UnliftC m a -> UnliftC m b -> UnliftC m a
*> :: UnliftC m a -> UnliftC m b -> UnliftC m b
$c*> :: forall (m :: * -> *) a b.
Applicative m =>
UnliftC m a -> UnliftC m b -> UnliftC m b
liftA2 :: (a -> b -> c) -> UnliftC m a -> UnliftC m b -> UnliftC m c
$cliftA2 :: forall (m :: * -> *) a b c.
Applicative m =>
(a -> b -> c) -> UnliftC m a -> UnliftC m b -> UnliftC m c
<*> :: UnliftC m (a -> b) -> UnliftC m a -> UnliftC m b
$c<*> :: forall (m :: * -> *) a b.
Applicative m =>
UnliftC m (a -> b) -> UnliftC m a -> UnliftC m b
pure :: a -> UnliftC m a
$cpure :: forall (m :: * -> *) a. Applicative m => a -> UnliftC m a
$cp1Applicative :: forall (m :: * -> *). Applicative m => Functor (UnliftC m)
Applicative, Applicative (UnliftC m)
a -> UnliftC m a
Applicative (UnliftC m)
-> (forall a b. UnliftC m a -> (a -> UnliftC m b) -> UnliftC m b)
-> (forall a b. UnliftC m a -> UnliftC m b -> UnliftC m b)
-> (forall a. a -> UnliftC m a)
-> Monad (UnliftC m)
UnliftC m a -> (a -> UnliftC m b) -> UnliftC m b
UnliftC m a -> UnliftC m b -> UnliftC m b
forall a. a -> UnliftC m a
forall a b. UnliftC m a -> UnliftC m b -> UnliftC m b
forall a b. UnliftC m a -> (a -> UnliftC m b) -> UnliftC m b
forall (m :: * -> *). Monad m => Applicative (UnliftC m)
forall (m :: * -> *) a. Monad m => a -> UnliftC m a
forall (m :: * -> *) a b.
Monad m =>
UnliftC m a -> UnliftC m b -> UnliftC m b
forall (m :: * -> *) a b.
Monad m =>
UnliftC m a -> (a -> UnliftC m b) -> UnliftC m b
forall (m :: * -> *).
Applicative m
-> (forall a b. m a -> (a -> m b) -> m b)
-> (forall a b. m a -> m b -> m b)
-> (forall a. a -> m a)
-> Monad m
return :: a -> UnliftC m a
$creturn :: forall (m :: * -> *) a. Monad m => a -> UnliftC m a
>> :: UnliftC m a -> UnliftC m b -> UnliftC m b
$c>> :: forall (m :: * -> *) a b.
Monad m =>
UnliftC m a -> UnliftC m b -> UnliftC m b
>>= :: UnliftC m a -> (a -> UnliftC m b) -> UnliftC m b
$c>>= :: forall (m :: * -> *) a b.
Monad m =>
UnliftC m a -> (a -> UnliftC m b) -> UnliftC m b
$cp1Monad :: forall (m :: * -> *). Monad m => Applicative (UnliftC m)
Monad
           , Applicative (UnliftC m)
UnliftC m a
Applicative (UnliftC m)
-> (forall a. UnliftC m a)
-> (forall a. UnliftC m a -> UnliftC m a -> UnliftC m a)
-> (forall a. UnliftC m a -> UnliftC m [a])
-> (forall a. UnliftC m a -> UnliftC m [a])
-> Alternative (UnliftC m)
UnliftC m a -> UnliftC m a -> UnliftC m a
UnliftC m a -> UnliftC m [a]
UnliftC m a -> UnliftC m [a]
forall a. UnliftC m a
forall a. UnliftC m a -> UnliftC m [a]
forall a. UnliftC m a -> UnliftC m a -> UnliftC m a
forall (f :: * -> *).
Applicative f
-> (forall a. f a)
-> (forall a. f a -> f a -> f a)
-> (forall a. f a -> f [a])
-> (forall a. f a -> f [a])
-> Alternative f
forall (m :: * -> *). Alternative m => Applicative (UnliftC m)
forall (m :: * -> *) a. Alternative m => UnliftC m a
forall (m :: * -> *) a.
Alternative m =>
UnliftC m a -> UnliftC m [a]
forall (m :: * -> *) a.
Alternative m =>
UnliftC m a -> UnliftC m a -> UnliftC m a
many :: UnliftC m a -> UnliftC m [a]
$cmany :: forall (m :: * -> *) a.
Alternative m =>
UnliftC m a -> UnliftC m [a]
some :: UnliftC m a -> UnliftC m [a]
$csome :: forall (m :: * -> *) a.
Alternative m =>
UnliftC m a -> UnliftC m [a]
<|> :: UnliftC m a -> UnliftC m a -> UnliftC m a
$c<|> :: forall (m :: * -> *) a.
Alternative m =>
UnliftC m a -> UnliftC m a -> UnliftC m a
empty :: UnliftC m a
$cempty :: forall (m :: * -> *) a. Alternative m => UnliftC m a
$cp1Alternative :: forall (m :: * -> *). Alternative m => Applicative (UnliftC m)
Alternative, Monad (UnliftC m)
Alternative (UnliftC m)
UnliftC m a
Alternative (UnliftC m)
-> Monad (UnliftC m)
-> (forall a. UnliftC m a)
-> (forall a. UnliftC m a -> UnliftC m a -> UnliftC m a)
-> MonadPlus (UnliftC m)
UnliftC m a -> UnliftC m a -> UnliftC m a
forall a. UnliftC m a
forall a. UnliftC m a -> UnliftC m a -> UnliftC m a
forall (m :: * -> *).
Alternative m
-> Monad m
-> (forall a. m a)
-> (forall a. m a -> m a -> m a)
-> MonadPlus m
forall (m :: * -> *). MonadPlus m => Monad (UnliftC m)
forall (m :: * -> *). MonadPlus m => Alternative (UnliftC m)
forall (m :: * -> *) a. MonadPlus m => UnliftC m a
forall (m :: * -> *) a.
MonadPlus m =>
UnliftC m a -> UnliftC m a -> UnliftC m a
mplus :: UnliftC m a -> UnliftC m a -> UnliftC m a
$cmplus :: forall (m :: * -> *) a.
MonadPlus m =>
UnliftC m a -> UnliftC m a -> UnliftC m a
mzero :: UnliftC m a
$cmzero :: forall (m :: * -> *) a. MonadPlus m => UnliftC m a
$cp2MonadPlus :: forall (m :: * -> *). MonadPlus m => Monad (UnliftC m)
$cp1MonadPlus :: forall (m :: * -> *). MonadPlus m => Alternative (UnliftC m)
MonadPlus
           , Monad (UnliftC m)
Monad (UnliftC m)
-> (forall a. (a -> UnliftC m a) -> UnliftC m a)
-> MonadFix (UnliftC m)
(a -> UnliftC m a) -> UnliftC m a
forall a. (a -> UnliftC m a) -> UnliftC m a
forall (m :: * -> *).
Monad m -> (forall a. (a -> m a) -> m a) -> MonadFix m
forall (m :: * -> *). MonadFix m => Monad (UnliftC m)
forall (m :: * -> *) a.
MonadFix m =>
(a -> UnliftC m a) -> UnliftC m a
mfix :: (a -> UnliftC m a) -> UnliftC m a
$cmfix :: forall (m :: * -> *) a.
MonadFix m =>
(a -> UnliftC m a) -> UnliftC m a
$cp1MonadFix :: forall (m :: * -> *). MonadFix m => Monad (UnliftC m)
MonadFix, Monad (UnliftC m)
Monad (UnliftC m)
-> (forall a. String -> UnliftC m a) -> MonadFail (UnliftC m)
String -> UnliftC m a
forall a. String -> UnliftC m a
forall (m :: * -> *).
Monad m -> (forall a. String -> m a) -> MonadFail m
forall (m :: * -> *). MonadFail m => Monad (UnliftC m)
forall (m :: * -> *) a. MonadFail m => String -> UnliftC m a
fail :: String -> UnliftC m a
$cfail :: forall (m :: * -> *) a. MonadFail m => String -> UnliftC m a
$cp1MonadFail :: forall (m :: * -> *). MonadFail m => Monad (UnliftC m)
MonadFail, Monad (UnliftC m)
Monad (UnliftC m)
-> (forall a. IO a -> UnliftC m a) -> MonadIO (UnliftC m)
IO a -> UnliftC m a
forall a. IO a -> UnliftC m a
forall (m :: * -> *).
Monad m -> (forall a. IO a -> m a) -> MonadIO m
forall (m :: * -> *). MonadIO m => Monad (UnliftC m)
forall (m :: * -> *) a. MonadIO m => IO a -> UnliftC m a
liftIO :: IO a -> UnliftC m a
$cliftIO :: forall (m :: * -> *) a. MonadIO m => IO a -> UnliftC m a
$cp1MonadIO :: forall (m :: * -> *). MonadIO m => Monad (UnliftC m)
MonadIO
           , Monad (UnliftC m)
e -> UnliftC m a
Monad (UnliftC m)
-> (forall e a. Exception e => e -> UnliftC m a)
-> MonadThrow (UnliftC m)
forall e a. Exception e => e -> UnliftC m a
forall (m :: * -> *).
Monad m -> (forall e a. Exception e => e -> m a) -> MonadThrow m
forall (m :: * -> *). MonadThrow m => Monad (UnliftC m)
forall (m :: * -> *) e a.
(MonadThrow m, Exception e) =>
e -> UnliftC m a
throwM :: e -> UnliftC m a
$cthrowM :: forall (m :: * -> *) e a.
(MonadThrow m, Exception e) =>
e -> UnliftC m a
$cp1MonadThrow :: forall (m :: * -> *). MonadThrow m => Monad (UnliftC m)
MonadThrow, MonadThrow (UnliftC m)
MonadThrow (UnliftC m)
-> (forall e a.
    Exception e =>
    UnliftC m a -> (e -> UnliftC m a) -> UnliftC m a)
-> MonadCatch (UnliftC m)
UnliftC m a -> (e -> UnliftC m a) -> UnliftC m a
forall e a.
Exception e =>
UnliftC m a -> (e -> UnliftC m a) -> UnliftC m a
forall (m :: * -> *).
MonadThrow m
-> (forall e a. Exception e => m a -> (e -> m a) -> m a)
-> MonadCatch m
forall (m :: * -> *). MonadCatch m => MonadThrow (UnliftC m)
forall (m :: * -> *) e a.
(MonadCatch m, Exception e) =>
UnliftC m a -> (e -> UnliftC m a) -> UnliftC m a
catch :: UnliftC m a -> (e -> UnliftC m a) -> UnliftC m a
$ccatch :: forall (m :: * -> *) e a.
(MonadCatch m, Exception e) =>
UnliftC m a -> (e -> UnliftC m a) -> UnliftC m a
$cp1MonadCatch :: forall (m :: * -> *). MonadCatch m => MonadThrow (UnliftC m)
MonadCatch, MonadCatch (UnliftC m)
MonadCatch (UnliftC m)
-> (forall b.
    ((forall a. UnliftC m a -> UnliftC m a) -> UnliftC m b)
    -> UnliftC m b)
-> (forall b.
    ((forall a. UnliftC m a -> UnliftC m a) -> UnliftC m b)
    -> UnliftC m b)
-> (forall a b c.
    UnliftC m a
    -> (a -> ExitCase b -> UnliftC m c)
    -> (a -> UnliftC m b)
    -> UnliftC m (b, c))
-> MonadMask (UnliftC m)
UnliftC m a
-> (a -> ExitCase b -> UnliftC m c)
-> (a -> UnliftC m b)
-> UnliftC m (b, c)
((forall a. UnliftC m a -> UnliftC m a) -> UnliftC m b)
-> UnliftC m b
((forall a. UnliftC m a -> UnliftC m a) -> UnliftC m b)
-> UnliftC m b
forall b.
((forall a. UnliftC m a -> UnliftC m a) -> UnliftC m b)
-> UnliftC m b
forall a b c.
UnliftC m a
-> (a -> ExitCase b -> UnliftC m c)
-> (a -> UnliftC m b)
-> UnliftC m (b, c)
forall (m :: * -> *).
MonadCatch m
-> (forall b. ((forall a. m a -> m a) -> m b) -> m b)
-> (forall b. ((forall a. m a -> m a) -> m b) -> m b)
-> (forall a b c.
    m a -> (a -> ExitCase b -> m c) -> (a -> m b) -> m (b, c))
-> MonadMask m
forall (m :: * -> *). MonadMask m => MonadCatch (UnliftC m)
forall (m :: * -> *) b.
MonadMask m =>
((forall a. UnliftC m a -> UnliftC m a) -> UnliftC m b)
-> UnliftC m b
forall (m :: * -> *) a b c.
MonadMask m =>
UnliftC m a
-> (a -> ExitCase b -> UnliftC m c)
-> (a -> UnliftC m b)
-> UnliftC m (b, c)
generalBracket :: UnliftC m a
-> (a -> ExitCase b -> UnliftC m c)
-> (a -> UnliftC m b)
-> UnliftC m (b, c)
$cgeneralBracket :: forall (m :: * -> *) a b c.
MonadMask m =>
UnliftC m a
-> (a -> ExitCase b -> UnliftC m c)
-> (a -> UnliftC m b)
-> UnliftC m (b, c)
uninterruptibleMask :: ((forall a. UnliftC m a -> UnliftC m a) -> UnliftC m b)
-> UnliftC m b
$cuninterruptibleMask :: forall (m :: * -> *) b.
MonadMask m =>
((forall a. UnliftC m a -> UnliftC m a) -> UnliftC m b)
-> UnliftC m b
mask :: ((forall a. UnliftC m a -> UnliftC m a) -> UnliftC m b)
-> UnliftC m b
$cmask :: forall (m :: * -> *) b.
MonadMask m =>
((forall a. UnliftC m a -> UnliftC m a) -> UnliftC m b)
-> UnliftC m b
$cp1MonadMask :: forall (m :: * -> *). MonadMask m => MonadCatch (UnliftC m)
MonadMask
           )
  deriving (m a -> UnliftC m a
(forall (m :: * -> *) a. Monad m => m a -> UnliftC m a)
-> MonadTrans UnliftC
forall (m :: * -> *) a. Monad m => m a -> UnliftC m a
forall (t :: Effect).
(forall (m :: * -> *) a. Monad m => m a -> t m a) -> MonadTrans t
lift :: m a -> UnliftC m a
$clift :: forall (m :: * -> *) a. Monad m => m a -> UnliftC m a
MonadTrans, MonadTrans UnliftC
m (StT UnliftC a) -> UnliftC m a
MonadTrans UnliftC
-> (forall (m :: * -> *) a.
    Monad m =>
    (Run UnliftC -> m a) -> UnliftC m a)
-> (forall (m :: * -> *) a.
    Monad m =>
    m (StT UnliftC a) -> UnliftC m a)
-> MonadTransControl UnliftC
(Run UnliftC -> m a) -> UnliftC m a
forall (m :: * -> *) a. Monad m => m (StT UnliftC a) -> UnliftC m a
forall (m :: * -> *) a.
Monad m =>
(Run UnliftC -> m a) -> UnliftC m a
forall (t :: Effect).
MonadTrans t
-> (forall (m :: * -> *) a. Monad m => (Run t -> m a) -> t m a)
-> (forall (m :: * -> *) a. Monad m => m (StT t a) -> t m a)
-> MonadTransControl t
restoreT :: m (StT UnliftC a) -> UnliftC m a
$crestoreT :: forall (m :: * -> *) a. Monad m => m (StT UnliftC a) -> UnliftC m a
liftWith :: (Run UnliftC -> m a) -> UnliftC m a
$cliftWith :: forall (m :: * -> *) a.
Monad m =>
(Run UnliftC -> m a) -> UnliftC m a
$cp1MonadTransControl :: MonadTrans UnliftC
MonadTransControl) via IdentityT

deriving via InterpretPrimC UnliftH (Unlift m) m
    instance Carrier m => Carrier (UnliftC m)