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

import Data.Coerce

import Control.Applicative
import Control.Monad
import Control.Monad.Trans
import Control.Monad.Catch
import Control.Monad.Fix

import Control.Effect.Internal
import Control.Effect.Internal.Derive
import Control.Effect.Internal.Union
import Control.Effect.Internal.Utils
import Control.Effect.Internal.KnownList

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

type RestDerivs top new m = StripPrefix new (StripPrefix top (Derivs m))

instance ( Carrier m
         , KnownList top
         , KnownList new
         , IntroConsistent top new m
         ) => Carrier (IntroC top new m) where
  type Derivs (IntroC top new m) = Append top (RestDerivs top new m)
  type Prims  (IntroC top new m) = Prims m

  algPrims :: Algebra' (Prims (IntroC top new m)) (IntroC top new m) a
algPrims = (Union (Prims m) m a -> m a)
-> Algebra' (Prims m) (IntroC top new m) a
coerce (forall a. Carrier m => Algebra' (Prims m) m a
forall (m :: * -> *) a. Carrier m => Algebra' (Prims m) m a
algPrims @m)
  {-# INLINEABLE algPrims #-}

  reformulate :: Reformulation'
  (Derivs (IntroC top new m))
  (Prims (IntroC top new m))
  (IntroC top new m)
  z
  a
reformulate forall x. IntroC top new m x -> z x
n Algebra (Prims (IntroC top new m)) z
alg =
    SList top
-> SList new
-> Algebra (Append top (Append new (RestDerivs top new m))) z
-> Algebra (Append top (RestDerivs top new m)) z
forall (right :: [Effect]) (m :: * -> *) (left :: [Effect])
       (mid :: [Effect]).
SList left
-> SList mid
-> Algebra (Append left (Append mid right)) m
-> Algebra (Append left right) m
weakenAlgMid
      @(RestDerivs top new m)
      (KnownList top => SList top
forall a (l :: [a]). KnownList l => SList l
singList @top)
      (KnownList new => SList new
forall a (l :: [a]). KnownList l => SList l
singList @new)
      (Reformulation' (Derivs m) (Prims m) m z x
forall (m :: * -> *) (z :: * -> *) a.
(Carrier m, Monad z) =>
Reformulation' (Derivs m) (Prims m) m z a
reformulate (IntroC top new m x -> z x
forall x. IntroC top new m x -> z x
n (IntroC top new m x -> z x)
-> (m x -> IntroC top new m x) -> m x -> z x
forall b a c. Coercible b a => (b -> c) -> (a -> b) -> a -> c
.# m x -> IntroC top new m x
forall (top :: [Effect]) (new :: [Effect]) (m :: * -> *) a.
m a -> IntroC top new m a
IntroC) forall x. Union (Prims m) z x -> z x
Algebra (Prims (IntroC top new m)) z
alg)
  {-# INLINEABLE reformulate #-}

  algDerivs :: Algebra' (Derivs (IntroC top new m)) (IntroC top new m) a
algDerivs =
    SList top
-> SList new
-> Algebra
     (Append top (Append new (RestDerivs top new m))) (IntroC top new m)
-> Algebra (Append top (RestDerivs top new m)) (IntroC top new m)
forall (right :: [Effect]) (m :: * -> *) (left :: [Effect])
       (mid :: [Effect]).
SList left
-> SList mid
-> Algebra (Append left (Append mid right)) m
-> Algebra (Append left right) m
weakenAlgMid
      @(RestDerivs top new m)
      (KnownList top => SList top
forall a (l :: [a]). KnownList l => SList l
singList @top)
      (KnownList new => SList new
forall a (l :: [a]). KnownList l => SList l
singList @new)
      ((Union (Derivs m) m x -> m x)
-> Union (Derivs m) (IntroC top new m) x -> IntroC top new m x
coerce (forall a. Carrier m => Algebra' (Derivs m) m a
forall (m :: * -> *) a. Carrier m => Algebra' (Derivs m) m a
algDerivs @m))
  {-# INLINEABLE algDerivs #-}


type IntroTopC = IntroC '[]
type IntroUnderC e = IntroC '[e]

-- | Synonym for 'IntroC' to match 'introUnderMany'
type IntroUnderManyC = IntroC

-- | A constraint that the effect stack of @m@ -- @'Control.Effect.Derivs' m@ --
-- begins with the effect @e@.
--
-- Note that unlike 'Control.Effect.Eff', this does not give
-- 'Control.Effect.Bundle' special treatment.
type HeadEff e m = (IntroConsistent '[] '[e] m, Carrier m)

-- | A constraint that the effect stack of @m@ -- @'Control.Effect.Derivs' m@ --
-- begins with @new@.
--
-- Note that unlike 'Control.Effect.Effs', this does not give
-- 'Control.Effect.Bundle' special treatment.
type HeadEffs new m = (IntroConsistent '[] new m, Carrier m)

-- | A constraint that the effect stack of @m@ -- @'Control.Effect.Derivs' m@ --
-- begins with @Append top new@.
type IntroConsistent top new m
  = (Append top (Append new (StripPrefix new (StripPrefix top (Derivs m)))) ~ Derivs m)

-- | Introduce multiple effects under a number of top effects of the effect
-- stack -- or rather, reveal those effects which were previously hidden.
--
-- @'Derivs' ('IntroUnderManyC' top new m) = Append top ('Control.Effect.Carrier.StripPrefix' (Append top new) ('Derivs' m))@
--
-- @'Prims'  ('IntroUnderManyC' top new m) = 'Prims' m@
introUnderMany :: forall top new m a
                . ( KnownList top
                  , KnownList new
                  , IntroConsistent top new m
                  )
               => IntroUnderManyC top new m a
               -> m a
introUnderMany :: IntroUnderManyC top new m a -> m a
introUnderMany = IntroUnderManyC top new m a -> m a
forall (top :: [Effect]) (new :: [Effect]) (m :: * -> *) a.
IntroC top new m a -> m a
runIntroC
{-# INLINE introUnderMany #-}

-- | Introduce multiple effects under the top effect of the effect stack
-- -- or rather, reveal those effects which were previously hidden.
--
-- @'Derivs' ('IntroUnderC' e new m) = e ': 'Control.Effect.Carrier.StripPrefix' (e ': new) ('Derivs' m)@
--
-- @'Prims'  ('IntroUnderC' e new m) = 'Prims' m@
introUnder :: forall new e m a
            . ( KnownList new
              , IntroConsistent '[e] new m
              )
           => IntroUnderC e new m a
           -> m a
introUnder :: IntroUnderC e new m a -> m a
introUnder = IntroUnderC e new m a -> m a
forall (top :: [Effect]) (new :: [Effect]) (m :: * -> *) a.
IntroC top new m a -> m a
runIntroC
{-# INLINE introUnder #-}

-- | Introduce an effect under the top effect of the effect stack
-- -- or rather, reveal that effect which was previously hidden.
--
-- @'Derivs' ('IntroUnderC' e '[new] m) = e ': 'Control.Effect.Carrier.StripPrefix' [e, new] ('Derivs' m)@
--
-- @'Prims'  ('IntroUnderC' e '[new] m) = 'Prims' m@
introUnder1 :: forall new e m a
             . IntroConsistent '[e] '[new] m
            => IntroUnderC e '[new] m a
            -> m a
introUnder1 :: IntroUnderC e '[new] m a -> m a
introUnder1 = IntroUnderC e '[new] m a -> m a
forall (top :: [Effect]) (new :: [Effect]) (m :: * -> *) a.
IntroC top new m a -> m a
runIntroC
{-# INLINE introUnder1 #-}

-- | Introduce multiple effects on the top of the effect stack
-- -- or rather, reveal effects previously hidden.
--
-- @'Derivs' ('IntroTopC' new m) = 'Control.Effect.Carrier.StripPrefix' new ('Derivs' m)@
--
-- @'Prims'  ('IntroTopC' new m) = 'Prims' m@
intro :: forall new m a
       . ( KnownList new
         , IntroConsistent '[] new m
         )
      => IntroTopC new m a
      -> m a
intro :: IntroTopC new m a -> m a
intro = IntroTopC new m a -> m a
forall (top :: [Effect]) (new :: [Effect]) (m :: * -> *) a.
IntroC top new m a -> m a
runIntroC
{-# INLINE intro #-}

-- | Introduce an effect at the top of the stack -- or rather, reveal an effect
-- previously hidden.
--
-- @'Derivs' ('IntroTopC' '[e] m) = 'Control.Effect.Carrier.StripPrefix' '[e] ('Derivs' m)@
--
-- @'Prims'  ('IntroTopC' '[e] m) = 'Prims' m@
intro1 :: forall e m a
        . IntroConsistent '[] '[e] m
       => IntroTopC '[e] m a
       -> m a
intro1 :: IntroTopC '[e] m a -> m a
intro1 = IntroTopC '[e] m a -> m a
forall (top :: [Effect]) (new :: [Effect]) (m :: * -> *) a.
IntroC top new m a -> m a
runIntroC
{-# INLINE intro1 #-}