{-# LANGUAGE Trustworthy #-}
module Grisette.Lib.Control.Monad.Trans.Cont
(
mrgRunContT,
mrgEvalContT,
mrgResetT,
)
where
import Control.Monad.Cont
import Grisette.Core.Data.Class.Bool
import Grisette.Core.Data.Class.Mergeable
import Grisette.Core.Data.Class.SimpleMergeable
import Grisette.Lib.Control.Monad
mrgRunContT :: (UnionLike m, Mergeable r) => ContT r m a -> (a -> m r) -> m r
mrgRunContT :: forall (m :: * -> *) r a.
(UnionLike m, Mergeable r) =>
ContT r m a -> (a -> m r) -> m r
mrgRunContT ContT r m a
c = forall (u :: * -> *) a. (UnionLike u, Mergeable a) => u a -> u a
merge forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {k} (r :: k) (m :: k -> *) a.
ContT r m a -> (a -> m r) -> m r
runContT ContT r m a
c
{-# INLINE mrgRunContT #-}
mrgEvalContT :: (UnionLike m, Mergeable r, Monad m) => ContT r m r -> m r
mrgEvalContT :: forall (m :: * -> *) r.
(UnionLike m, Mergeable r, Monad m) =>
ContT r m r -> m r
mrgEvalContT ContT r m r
c = forall {k} (r :: k) (m :: k -> *) a.
ContT r m a -> (a -> m r) -> m r
runContT ContT r m r
c forall (u :: * -> *) a. (MonadUnion u, Mergeable a) => a -> u a
mrgReturn
{-# INLINE mrgEvalContT #-}
mrgResetT :: (UnionLike m, Mergeable r, Monad m) => Monad m => ContT r m r -> ContT r' m r
mrgResetT :: forall (m :: * -> *) r r'.
(UnionLike m, Mergeable r, Monad m, Monad m) =>
ContT r m r -> ContT r' m r
mrgResetT = forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r.
(UnionLike m, Mergeable r, Monad m) =>
ContT r m r -> m r
mrgEvalContT
{-# INLINE mrgResetT #-}