{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UndecidableInstances #-}
module Control.Carrier.Interpret
(
runInterpret
, runInterpretState
, InterpretC(..)
, Reifies
, Handler
, Algebra
, Has
, run
) where
import Control.Algebra
import Control.Applicative (Alternative(..))
import Control.Carrier.State.Strict
import Control.Monad (MonadPlus(..))
import qualified Control.Monad.Fail as Fail
import Control.Monad.Fix
import Control.Monad.IO.Class
import Control.Monad.Trans.Class
import Data.Functor.Const (Const(..))
import Unsafe.Coerce (unsafeCoerce)
newtype Handler sig m = Handler
{ Handler sig m
-> forall s x. sig (InterpretC s sig m) x -> InterpretC s sig m x
runHandler :: forall s x . sig (InterpretC s sig m) x -> InterpretC s sig m x }
class Reifies s a | s -> a where
reflect :: Const a s
data Skolem
newtype Magic a r = Magic (Reifies Skolem a => Const r Skolem)
reify :: a -> (forall s . Reifies s a => Const r s) -> r
reify :: a -> (forall s. Reifies s a => Const r s) -> r
reify a :: a
a k :: forall s. Reifies s a => Const r s
k = Magic a r -> a -> r
forall a b. a -> b
unsafeCoerce ((Reifies Skolem a => Const r Skolem) -> Magic a r
forall a r. (Reifies Skolem a => Const r Skolem) -> Magic a r
Magic Reifies Skolem a => Const r Skolem
forall s. Reifies s a => Const r s
k) a
a
runInterpret
:: (HFunctor eff, Monad m)
=> (forall x . eff m x -> m x)
-> (forall s . Reifies s (Handler eff m) => InterpretC s eff m a)
-> m a
runInterpret :: (forall x. eff m x -> m x)
-> (forall s. Reifies s (Handler eff m) => InterpretC s eff m a)
-> m a
runInterpret f :: forall x. eff m x -> m x
f m :: forall s. Reifies s (Handler eff m) => InterpretC s eff m a
m = Handler eff m
-> (forall s. Reifies s (Handler eff m) => Const (m a) s) -> m a
forall a r. a -> (forall s. Reifies s a => Const r s) -> r
reify ((forall s x. eff (InterpretC s eff m) x -> InterpretC s eff m x)
-> Handler eff m
forall (sig :: (* -> *) -> * -> *) (m :: * -> *).
(forall s x. sig (InterpretC s sig m) x -> InterpretC s sig m x)
-> Handler sig m
Handler (m x -> InterpretC s eff m x
forall s (sig :: (* -> *) -> * -> *) (m :: * -> *) a.
m a -> InterpretC s sig m a
InterpretC (m x -> InterpretC s eff m x)
-> (eff (InterpretC s eff m) x -> m x)
-> eff (InterpretC s eff m) x
-> InterpretC s eff m x
forall b c a. (b -> c) -> (a -> b) -> a -> c
. eff m x -> m x
forall x. eff m x -> m x
f (eff m x -> m x)
-> (eff (InterpretC s eff m) x -> eff m x)
-> eff (InterpretC s eff m) x
-> m x
forall b c a. (b -> c) -> (a -> b) -> a -> c
. eff (InterpretC s eff m) x -> eff m x
forall (sig :: (* -> *) -> * -> *) (f :: * -> *) (g :: * -> *) a.
(HFunctor sig, Functor f, Coercible f g) =>
sig f a -> sig g a
handleCoercible)) (InterpretC s eff m a -> Const (m a) s
forall s (eff :: (* -> *) -> * -> *) (m :: * -> *) x.
InterpretC s eff m x -> Const (m x) s
go InterpretC s eff m a
forall s. Reifies s (Handler eff m) => InterpretC s eff m a
m) where
go :: InterpretC s eff m x -> Const (m x) s
go :: InterpretC s eff m x -> Const (m x) s
go (InterpretC m :: m x
m) = m x -> Const (m x) s
forall k a (b :: k). a -> Const a b
Const m x
m
runInterpretState
:: (HFunctor eff, Monad m)
=> (forall x . s -> eff (StateC s m) x -> m (s, x))
-> s
-> (forall t . Reifies t (Handler eff (StateC s m)) => InterpretC t eff (StateC s m) a)
-> m (s, a)
runInterpretState :: (forall x. s -> eff (StateC s m) x -> m (s, x))
-> s
-> (forall t.
Reifies t (Handler eff (StateC s m)) =>
InterpretC t eff (StateC s m) a)
-> m (s, a)
runInterpretState handler :: forall x. s -> eff (StateC s m) x -> m (s, x)
handler state :: s
state m :: forall t.
Reifies t (Handler eff (StateC s m)) =>
InterpretC t eff (StateC s m) a
m
= s -> StateC s m a -> m (s, a)
forall s (m :: * -> *) a. s -> StateC s m a -> m (s, a)
runState s
state
(StateC s m a -> m (s, a)) -> StateC s m a -> m (s, a)
forall a b. (a -> b) -> a -> b
$ (forall x. eff (StateC s m) x -> StateC s m x)
-> (forall t.
Reifies t (Handler eff (StateC s m)) =>
InterpretC t eff (StateC s m) a)
-> StateC s m a
forall (eff :: (* -> *) -> * -> *) (m :: * -> *) a.
(HFunctor eff, Monad m) =>
(forall x. eff m x -> m x)
-> (forall s. Reifies s (Handler eff m) => InterpretC s eff m a)
-> m a
runInterpret (\e :: eff (StateC s m) x
e -> (s -> m (s, x)) -> StateC s m x
forall s (m :: * -> *) a. (s -> m (s, a)) -> StateC s m a
StateC (s -> eff (StateC s m) x -> m (s, x)
forall x. s -> eff (StateC s m) x -> m (s, x)
`handler` eff (StateC s m) x
e)) forall t.
Reifies t (Handler eff (StateC s m)) =>
InterpretC t eff (StateC s m) a
m
newtype InterpretC s (sig :: (* -> *) -> * -> *) m a = InterpretC (m a)
deriving (Applicative (InterpretC s sig m)
InterpretC s sig m a
Applicative (InterpretC s sig m) =>
(forall a. InterpretC s sig m a)
-> (forall a.
InterpretC s sig m a
-> InterpretC s sig m a -> InterpretC s sig m a)
-> (forall a. InterpretC s sig m a -> InterpretC s sig m [a])
-> (forall a. InterpretC s sig m a -> InterpretC s sig m [a])
-> Alternative (InterpretC s sig m)
InterpretC s sig m a
-> InterpretC s sig m a -> InterpretC s sig m a
InterpretC s sig m a -> InterpretC s sig m [a]
InterpretC s sig m a -> InterpretC s sig m [a]
forall a. InterpretC s sig m a
forall a. InterpretC s sig m a -> InterpretC s sig m [a]
forall a.
InterpretC s sig m a
-> InterpretC s sig m a -> InterpretC s sig m a
forall s (sig :: (* -> *) -> * -> *) (m :: * -> *).
Alternative m =>
Applicative (InterpretC s sig m)
forall s (sig :: (* -> *) -> * -> *) (m :: * -> *) a.
Alternative m =>
InterpretC s sig m a
forall s (sig :: (* -> *) -> * -> *) (m :: * -> *) a.
Alternative m =>
InterpretC s sig m a -> InterpretC s sig m [a]
forall s (sig :: (* -> *) -> * -> *) (m :: * -> *) a.
Alternative m =>
InterpretC s sig m a
-> InterpretC s sig m a -> InterpretC s sig 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 :: InterpretC s sig m a -> InterpretC s sig m [a]
$cmany :: forall s (sig :: (* -> *) -> * -> *) (m :: * -> *) a.
Alternative m =>
InterpretC s sig m a -> InterpretC s sig m [a]
some :: InterpretC s sig m a -> InterpretC s sig m [a]
$csome :: forall s (sig :: (* -> *) -> * -> *) (m :: * -> *) a.
Alternative m =>
InterpretC s sig m a -> InterpretC s sig m [a]
<|> :: InterpretC s sig m a
-> InterpretC s sig m a -> InterpretC s sig m a
$c<|> :: forall s (sig :: (* -> *) -> * -> *) (m :: * -> *) a.
Alternative m =>
InterpretC s sig m a
-> InterpretC s sig m a -> InterpretC s sig m a
empty :: InterpretC s sig m a
$cempty :: forall s (sig :: (* -> *) -> * -> *) (m :: * -> *) a.
Alternative m =>
InterpretC s sig m a
$cp1Alternative :: forall s (sig :: (* -> *) -> * -> *) (m :: * -> *).
Alternative m =>
Applicative (InterpretC s sig m)
Alternative, Functor (InterpretC s sig m)
a -> InterpretC s sig m a
Functor (InterpretC s sig m) =>
(forall a. a -> InterpretC s sig m a)
-> (forall a b.
InterpretC s sig m (a -> b)
-> InterpretC s sig m a -> InterpretC s sig m b)
-> (forall a b c.
(a -> b -> c)
-> InterpretC s sig m a
-> InterpretC s sig m b
-> InterpretC s sig m c)
-> (forall a b.
InterpretC s sig m a
-> InterpretC s sig m b -> InterpretC s sig m b)
-> (forall a b.
InterpretC s sig m a
-> InterpretC s sig m b -> InterpretC s sig m a)
-> Applicative (InterpretC s sig m)
InterpretC s sig m a
-> InterpretC s sig m b -> InterpretC s sig m b
InterpretC s sig m a
-> InterpretC s sig m b -> InterpretC s sig m a
InterpretC s sig m (a -> b)
-> InterpretC s sig m a -> InterpretC s sig m b
(a -> b -> c)
-> InterpretC s sig m a
-> InterpretC s sig m b
-> InterpretC s sig m c
forall a. a -> InterpretC s sig m a
forall a b.
InterpretC s sig m a
-> InterpretC s sig m b -> InterpretC s sig m a
forall a b.
InterpretC s sig m a
-> InterpretC s sig m b -> InterpretC s sig m b
forall a b.
InterpretC s sig m (a -> b)
-> InterpretC s sig m a -> InterpretC s sig m b
forall a b c.
(a -> b -> c)
-> InterpretC s sig m a
-> InterpretC s sig m b
-> InterpretC s sig m c
forall s (sig :: (* -> *) -> * -> *) (m :: * -> *).
Applicative m =>
Functor (InterpretC s sig m)
forall s (sig :: (* -> *) -> * -> *) (m :: * -> *) a.
Applicative m =>
a -> InterpretC s sig m a
forall s (sig :: (* -> *) -> * -> *) (m :: * -> *) a b.
Applicative m =>
InterpretC s sig m a
-> InterpretC s sig m b -> InterpretC s sig m a
forall s (sig :: (* -> *) -> * -> *) (m :: * -> *) a b.
Applicative m =>
InterpretC s sig m a
-> InterpretC s sig m b -> InterpretC s sig m b
forall s (sig :: (* -> *) -> * -> *) (m :: * -> *) a b.
Applicative m =>
InterpretC s sig m (a -> b)
-> InterpretC s sig m a -> InterpretC s sig m b
forall s (sig :: (* -> *) -> * -> *) (m :: * -> *) a b c.
Applicative m =>
(a -> b -> c)
-> InterpretC s sig m a
-> InterpretC s sig m b
-> InterpretC s sig 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
<* :: InterpretC s sig m a
-> InterpretC s sig m b -> InterpretC s sig m a
$c<* :: forall s (sig :: (* -> *) -> * -> *) (m :: * -> *) a b.
Applicative m =>
InterpretC s sig m a
-> InterpretC s sig m b -> InterpretC s sig m a
*> :: InterpretC s sig m a
-> InterpretC s sig m b -> InterpretC s sig m b
$c*> :: forall s (sig :: (* -> *) -> * -> *) (m :: * -> *) a b.
Applicative m =>
InterpretC s sig m a
-> InterpretC s sig m b -> InterpretC s sig m b
liftA2 :: (a -> b -> c)
-> InterpretC s sig m a
-> InterpretC s sig m b
-> InterpretC s sig m c
$cliftA2 :: forall s (sig :: (* -> *) -> * -> *) (m :: * -> *) a b c.
Applicative m =>
(a -> b -> c)
-> InterpretC s sig m a
-> InterpretC s sig m b
-> InterpretC s sig m c
<*> :: InterpretC s sig m (a -> b)
-> InterpretC s sig m a -> InterpretC s sig m b
$c<*> :: forall s (sig :: (* -> *) -> * -> *) (m :: * -> *) a b.
Applicative m =>
InterpretC s sig m (a -> b)
-> InterpretC s sig m a -> InterpretC s sig m b
pure :: a -> InterpretC s sig m a
$cpure :: forall s (sig :: (* -> *) -> * -> *) (m :: * -> *) a.
Applicative m =>
a -> InterpretC s sig m a
$cp1Applicative :: forall s (sig :: (* -> *) -> * -> *) (m :: * -> *).
Applicative m =>
Functor (InterpretC s sig m)
Applicative, a -> InterpretC s sig m b -> InterpretC s sig m a
(a -> b) -> InterpretC s sig m a -> InterpretC s sig m b
(forall a b.
(a -> b) -> InterpretC s sig m a -> InterpretC s sig m b)
-> (forall a b. a -> InterpretC s sig m b -> InterpretC s sig m a)
-> Functor (InterpretC s sig m)
forall a b. a -> InterpretC s sig m b -> InterpretC s sig m a
forall a b.
(a -> b) -> InterpretC s sig m a -> InterpretC s sig m b
forall s (sig :: (* -> *) -> * -> *) (m :: * -> *) a b.
Functor m =>
a -> InterpretC s sig m b -> InterpretC s sig m a
forall s (sig :: (* -> *) -> * -> *) (m :: * -> *) a b.
Functor m =>
(a -> b) -> InterpretC s sig m a -> InterpretC s sig m b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> InterpretC s sig m b -> InterpretC s sig m a
$c<$ :: forall s (sig :: (* -> *) -> * -> *) (m :: * -> *) a b.
Functor m =>
a -> InterpretC s sig m b -> InterpretC s sig m a
fmap :: (a -> b) -> InterpretC s sig m a -> InterpretC s sig m b
$cfmap :: forall s (sig :: (* -> *) -> * -> *) (m :: * -> *) a b.
Functor m =>
(a -> b) -> InterpretC s sig m a -> InterpretC s sig m b
Functor, Applicative (InterpretC s sig m)
a -> InterpretC s sig m a
Applicative (InterpretC s sig m) =>
(forall a b.
InterpretC s sig m a
-> (a -> InterpretC s sig m b) -> InterpretC s sig m b)
-> (forall a b.
InterpretC s sig m a
-> InterpretC s sig m b -> InterpretC s sig m b)
-> (forall a. a -> InterpretC s sig m a)
-> Monad (InterpretC s sig m)
InterpretC s sig m a
-> (a -> InterpretC s sig m b) -> InterpretC s sig m b
InterpretC s sig m a
-> InterpretC s sig m b -> InterpretC s sig m b
forall a. a -> InterpretC s sig m a
forall a b.
InterpretC s sig m a
-> InterpretC s sig m b -> InterpretC s sig m b
forall a b.
InterpretC s sig m a
-> (a -> InterpretC s sig m b) -> InterpretC s sig m b
forall s (sig :: (* -> *) -> * -> *) (m :: * -> *).
Monad m =>
Applicative (InterpretC s sig m)
forall s (sig :: (* -> *) -> * -> *) (m :: * -> *) a.
Monad m =>
a -> InterpretC s sig m a
forall s (sig :: (* -> *) -> * -> *) (m :: * -> *) a b.
Monad m =>
InterpretC s sig m a
-> InterpretC s sig m b -> InterpretC s sig m b
forall s (sig :: (* -> *) -> * -> *) (m :: * -> *) a b.
Monad m =>
InterpretC s sig m a
-> (a -> InterpretC s sig m b) -> InterpretC s sig 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 -> InterpretC s sig m a
$creturn :: forall s (sig :: (* -> *) -> * -> *) (m :: * -> *) a.
Monad m =>
a -> InterpretC s sig m a
>> :: InterpretC s sig m a
-> InterpretC s sig m b -> InterpretC s sig m b
$c>> :: forall s (sig :: (* -> *) -> * -> *) (m :: * -> *) a b.
Monad m =>
InterpretC s sig m a
-> InterpretC s sig m b -> InterpretC s sig m b
>>= :: InterpretC s sig m a
-> (a -> InterpretC s sig m b) -> InterpretC s sig m b
$c>>= :: forall s (sig :: (* -> *) -> * -> *) (m :: * -> *) a b.
Monad m =>
InterpretC s sig m a
-> (a -> InterpretC s sig m b) -> InterpretC s sig m b
$cp1Monad :: forall s (sig :: (* -> *) -> * -> *) (m :: * -> *).
Monad m =>
Applicative (InterpretC s sig m)
Monad, Monad (InterpretC s sig m)
Monad (InterpretC s sig m) =>
(forall a. String -> InterpretC s sig m a)
-> MonadFail (InterpretC s sig m)
String -> InterpretC s sig m a
forall a. String -> InterpretC s sig m a
forall s (sig :: (* -> *) -> * -> *) (m :: * -> *).
MonadFail m =>
Monad (InterpretC s sig m)
forall s (sig :: (* -> *) -> * -> *) (m :: * -> *) a.
MonadFail m =>
String -> InterpretC s sig m a
forall (m :: * -> *).
Monad m =>
(forall a. String -> m a) -> MonadFail m
fail :: String -> InterpretC s sig m a
$cfail :: forall s (sig :: (* -> *) -> * -> *) (m :: * -> *) a.
MonadFail m =>
String -> InterpretC s sig m a
$cp1MonadFail :: forall s (sig :: (* -> *) -> * -> *) (m :: * -> *).
MonadFail m =>
Monad (InterpretC s sig m)
Fail.MonadFail, Monad (InterpretC s sig m)
Monad (InterpretC s sig m) =>
(forall a. (a -> InterpretC s sig m a) -> InterpretC s sig m a)
-> MonadFix (InterpretC s sig m)
(a -> InterpretC s sig m a) -> InterpretC s sig m a
forall a. (a -> InterpretC s sig m a) -> InterpretC s sig m a
forall s (sig :: (* -> *) -> * -> *) (m :: * -> *).
MonadFix m =>
Monad (InterpretC s sig m)
forall s (sig :: (* -> *) -> * -> *) (m :: * -> *) a.
MonadFix m =>
(a -> InterpretC s sig m a) -> InterpretC s sig m a
forall (m :: * -> *).
Monad m =>
(forall a. (a -> m a) -> m a) -> MonadFix m
mfix :: (a -> InterpretC s sig m a) -> InterpretC s sig m a
$cmfix :: forall s (sig :: (* -> *) -> * -> *) (m :: * -> *) a.
MonadFix m =>
(a -> InterpretC s sig m a) -> InterpretC s sig m a
$cp1MonadFix :: forall s (sig :: (* -> *) -> * -> *) (m :: * -> *).
MonadFix m =>
Monad (InterpretC s sig m)
MonadFix, Monad (InterpretC s sig m)
Monad (InterpretC s sig m) =>
(forall a. IO a -> InterpretC s sig m a)
-> MonadIO (InterpretC s sig m)
IO a -> InterpretC s sig m a
forall a. IO a -> InterpretC s sig m a
forall s (sig :: (* -> *) -> * -> *) (m :: * -> *).
MonadIO m =>
Monad (InterpretC s sig m)
forall s (sig :: (* -> *) -> * -> *) (m :: * -> *) a.
MonadIO m =>
IO a -> InterpretC s sig m a
forall (m :: * -> *).
Monad m =>
(forall a. IO a -> m a) -> MonadIO m
liftIO :: IO a -> InterpretC s sig m a
$cliftIO :: forall s (sig :: (* -> *) -> * -> *) (m :: * -> *) a.
MonadIO m =>
IO a -> InterpretC s sig m a
$cp1MonadIO :: forall s (sig :: (* -> *) -> * -> *) (m :: * -> *).
MonadIO m =>
Monad (InterpretC s sig m)
MonadIO, Monad (InterpretC s sig m)
Alternative (InterpretC s sig m)
InterpretC s sig m a
(Alternative (InterpretC s sig m), Monad (InterpretC s sig m)) =>
(forall a. InterpretC s sig m a)
-> (forall a.
InterpretC s sig m a
-> InterpretC s sig m a -> InterpretC s sig m a)
-> MonadPlus (InterpretC s sig m)
InterpretC s sig m a
-> InterpretC s sig m a -> InterpretC s sig m a
forall a. InterpretC s sig m a
forall a.
InterpretC s sig m a
-> InterpretC s sig m a -> InterpretC s sig m a
forall s (sig :: (* -> *) -> * -> *) (m :: * -> *).
MonadPlus m =>
Monad (InterpretC s sig m)
forall s (sig :: (* -> *) -> * -> *) (m :: * -> *).
MonadPlus m =>
Alternative (InterpretC s sig m)
forall s (sig :: (* -> *) -> * -> *) (m :: * -> *) a.
MonadPlus m =>
InterpretC s sig m a
forall s (sig :: (* -> *) -> * -> *) (m :: * -> *) a.
MonadPlus m =>
InterpretC s sig m a
-> InterpretC s sig m a -> InterpretC s sig m a
forall (m :: * -> *).
(Alternative m, Monad m) =>
(forall a. m a) -> (forall a. m a -> m a -> m a) -> MonadPlus m
mplus :: InterpretC s sig m a
-> InterpretC s sig m a -> InterpretC s sig m a
$cmplus :: forall s (sig :: (* -> *) -> * -> *) (m :: * -> *) a.
MonadPlus m =>
InterpretC s sig m a
-> InterpretC s sig m a -> InterpretC s sig m a
mzero :: InterpretC s sig m a
$cmzero :: forall s (sig :: (* -> *) -> * -> *) (m :: * -> *) a.
MonadPlus m =>
InterpretC s sig m a
$cp2MonadPlus :: forall s (sig :: (* -> *) -> * -> *) (m :: * -> *).
MonadPlus m =>
Monad (InterpretC s sig m)
$cp1MonadPlus :: forall s (sig :: (* -> *) -> * -> *) (m :: * -> *).
MonadPlus m =>
Alternative (InterpretC s sig m)
MonadPlus)
instance MonadTrans (InterpretC s sig) where
lift :: m a -> InterpretC s sig m a
lift = m a -> InterpretC s sig m a
forall s (sig :: (* -> *) -> * -> *) (m :: * -> *) a.
m a -> InterpretC s sig m a
InterpretC
instance (HFunctor eff, HFunctor sig, Reifies s (Handler eff m), Monad m, Algebra sig m) => Algebra (eff :+: sig) (InterpretC s eff m) where
alg :: (:+:) eff sig (InterpretC s eff m) a -> InterpretC s eff m a
alg (L eff :: eff (InterpretC s eff m) a
eff) = Handler eff m -> eff (InterpretC s eff m) a -> InterpretC s eff m a
forall (sig :: (* -> *) -> * -> *) (m :: * -> *).
Handler sig m
-> forall s x. sig (InterpretC s sig m) x -> InterpretC s sig m x
runHandler (Const (Handler eff m) s -> Handler eff m
forall a k (b :: k). Const a b -> a
getConst (forall a. Reifies s a => Const a s
forall s a. Reifies s a => Const a s
reflect @s)) eff (InterpretC s eff m) a
eff
alg (R other :: sig (InterpretC s eff m) a
other) = m a -> InterpretC s eff m a
forall s (sig :: (* -> *) -> * -> *) (m :: * -> *) a.
m a -> InterpretC s sig m a
InterpretC (sig m a -> m a
forall (sig :: (* -> *) -> * -> *) (m :: * -> *) a.
Algebra sig m =>
sig m a -> m a
alg (sig (InterpretC s eff m) a -> sig m a
forall (sig :: (* -> *) -> * -> *) (f :: * -> *) (g :: * -> *) a.
(HFunctor sig, Functor f, Coercible f g) =>
sig f a -> sig g a
handleCoercible sig (InterpretC s eff m) a
other))