module Control.Effect.Internal.ViaAlg where

import Data.Coerce
import Control.Effect.Internal.Union

type RepresentationalT = RepresentationalEff

newtype ViaAlg (s :: *) (e :: Effect) m a = ViaAlg {
    ViaAlg s e m a -> m a
unViaAlg :: m a
  }
  deriving (a -> ViaAlg s e m b -> ViaAlg s e m a
(a -> b) -> ViaAlg s e m a -> ViaAlg s e m b
(forall a b. (a -> b) -> ViaAlg s e m a -> ViaAlg s e m b)
-> (forall a b. a -> ViaAlg s e m b -> ViaAlg s e m a)
-> Functor (ViaAlg s e m)
forall a b. a -> ViaAlg s e m b -> ViaAlg s e m a
forall a b. (a -> b) -> ViaAlg s e m a -> ViaAlg s e m b
forall s (e :: Effect) (m :: * -> *) a b.
Functor m =>
a -> ViaAlg s e m b -> ViaAlg s e m a
forall s (e :: Effect) (m :: * -> *) a b.
Functor m =>
(a -> b) -> ViaAlg s e m a -> ViaAlg s e m b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> ViaAlg s e m b -> ViaAlg s e m a
$c<$ :: forall s (e :: Effect) (m :: * -> *) a b.
Functor m =>
a -> ViaAlg s e m b -> ViaAlg s e m a
fmap :: (a -> b) -> ViaAlg s e m a -> ViaAlg s e m b
$cfmap :: forall s (e :: Effect) (m :: * -> *) a b.
Functor m =>
(a -> b) -> ViaAlg s e m a -> ViaAlg s e m b
Functor, Functor (ViaAlg s e m)
a -> ViaAlg s e m a
Functor (ViaAlg s e m)
-> (forall a. a -> ViaAlg s e m a)
-> (forall a b.
    ViaAlg s e m (a -> b) -> ViaAlg s e m a -> ViaAlg s e m b)
-> (forall a b c.
    (a -> b -> c)
    -> ViaAlg s e m a -> ViaAlg s e m b -> ViaAlg s e m c)
-> (forall a b. ViaAlg s e m a -> ViaAlg s e m b -> ViaAlg s e m b)
-> (forall a b. ViaAlg s e m a -> ViaAlg s e m b -> ViaAlg s e m a)
-> Applicative (ViaAlg s e m)
ViaAlg s e m a -> ViaAlg s e m b -> ViaAlg s e m b
ViaAlg s e m a -> ViaAlg s e m b -> ViaAlg s e m a
ViaAlg s e m (a -> b) -> ViaAlg s e m a -> ViaAlg s e m b
(a -> b -> c) -> ViaAlg s e m a -> ViaAlg s e m b -> ViaAlg s e m c
forall a. a -> ViaAlg s e m a
forall a b. ViaAlg s e m a -> ViaAlg s e m b -> ViaAlg s e m a
forall a b. ViaAlg s e m a -> ViaAlg s e m b -> ViaAlg s e m b
forall a b.
ViaAlg s e m (a -> b) -> ViaAlg s e m a -> ViaAlg s e m b
forall a b c.
(a -> b -> c) -> ViaAlg s e m a -> ViaAlg s e m b -> ViaAlg s e m c
forall s (e :: Effect) (m :: * -> *).
Applicative m =>
Functor (ViaAlg s e m)
forall s (e :: Effect) (m :: * -> *) a.
Applicative m =>
a -> ViaAlg s e m a
forall s (e :: Effect) (m :: * -> *) a b.
Applicative m =>
ViaAlg s e m a -> ViaAlg s e m b -> ViaAlg s e m a
forall s (e :: Effect) (m :: * -> *) a b.
Applicative m =>
ViaAlg s e m a -> ViaAlg s e m b -> ViaAlg s e m b
forall s (e :: Effect) (m :: * -> *) a b.
Applicative m =>
ViaAlg s e m (a -> b) -> ViaAlg s e m a -> ViaAlg s e m b
forall s (e :: Effect) (m :: * -> *) a b c.
Applicative m =>
(a -> b -> c) -> ViaAlg s e m a -> ViaAlg s e m b -> ViaAlg s e 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
<* :: ViaAlg s e m a -> ViaAlg s e m b -> ViaAlg s e m a
$c<* :: forall s (e :: Effect) (m :: * -> *) a b.
Applicative m =>
ViaAlg s e m a -> ViaAlg s e m b -> ViaAlg s e m a
*> :: ViaAlg s e m a -> ViaAlg s e m b -> ViaAlg s e m b
$c*> :: forall s (e :: Effect) (m :: * -> *) a b.
Applicative m =>
ViaAlg s e m a -> ViaAlg s e m b -> ViaAlg s e m b
liftA2 :: (a -> b -> c) -> ViaAlg s e m a -> ViaAlg s e m b -> ViaAlg s e m c
$cliftA2 :: forall s (e :: Effect) (m :: * -> *) a b c.
Applicative m =>
(a -> b -> c) -> ViaAlg s e m a -> ViaAlg s e m b -> ViaAlg s e m c
<*> :: ViaAlg s e m (a -> b) -> ViaAlg s e m a -> ViaAlg s e m b
$c<*> :: forall s (e :: Effect) (m :: * -> *) a b.
Applicative m =>
ViaAlg s e m (a -> b) -> ViaAlg s e m a -> ViaAlg s e m b
pure :: a -> ViaAlg s e m a
$cpure :: forall s (e :: Effect) (m :: * -> *) a.
Applicative m =>
a -> ViaAlg s e m a
$cp1Applicative :: forall s (e :: Effect) (m :: * -> *).
Applicative m =>
Functor (ViaAlg s e m)
Applicative, Applicative (ViaAlg s e m)
a -> ViaAlg s e m a
Applicative (ViaAlg s e m)
-> (forall a b.
    ViaAlg s e m a -> (a -> ViaAlg s e m b) -> ViaAlg s e m b)
-> (forall a b. ViaAlg s e m a -> ViaAlg s e m b -> ViaAlg s e m b)
-> (forall a. a -> ViaAlg s e m a)
-> Monad (ViaAlg s e m)
ViaAlg s e m a -> (a -> ViaAlg s e m b) -> ViaAlg s e m b
ViaAlg s e m a -> ViaAlg s e m b -> ViaAlg s e m b
forall a. a -> ViaAlg s e m a
forall a b. ViaAlg s e m a -> ViaAlg s e m b -> ViaAlg s e m b
forall a b.
ViaAlg s e m a -> (a -> ViaAlg s e m b) -> ViaAlg s e m b
forall s (e :: Effect) (m :: * -> *).
Monad m =>
Applicative (ViaAlg s e m)
forall s (e :: Effect) (m :: * -> *) a.
Monad m =>
a -> ViaAlg s e m a
forall s (e :: Effect) (m :: * -> *) a b.
Monad m =>
ViaAlg s e m a -> ViaAlg s e m b -> ViaAlg s e m b
forall s (e :: Effect) (m :: * -> *) a b.
Monad m =>
ViaAlg s e m a -> (a -> ViaAlg s e m b) -> ViaAlg s e 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 -> ViaAlg s e m a
$creturn :: forall s (e :: Effect) (m :: * -> *) a.
Monad m =>
a -> ViaAlg s e m a
>> :: ViaAlg s e m a -> ViaAlg s e m b -> ViaAlg s e m b
$c>> :: forall s (e :: Effect) (m :: * -> *) a b.
Monad m =>
ViaAlg s e m a -> ViaAlg s e m b -> ViaAlg s e m b
>>= :: ViaAlg s e m a -> (a -> ViaAlg s e m b) -> ViaAlg s e m b
$c>>= :: forall s (e :: Effect) (m :: * -> *) a b.
Monad m =>
ViaAlg s e m a -> (a -> ViaAlg s e m b) -> ViaAlg s e m b
$cp1Monad :: forall s (e :: Effect) (m :: * -> *).
Monad m =>
Applicative (ViaAlg s e m)
Monad)

newtype ReifiedEffAlgebra e m = ReifiedEffAlgebra (forall x. e m x -> m x)

viaAlgT :: forall s e t m a. RepresentationalT t => t m a -> t (ViaAlg s e m) a
viaAlgT :: t m a -> t (ViaAlg s e m) a
viaAlgT = t m a -> t (ViaAlg s e m) a
coerce
{-# INLINE viaAlgT #-}

unViaAlgT :: forall s e t m a. RepresentationalT t => t (ViaAlg s e m) a -> t m a
unViaAlgT :: t (ViaAlg s e m) a -> t m a
unViaAlgT = t (ViaAlg s e m) a -> t m a
coerce
{-# INLINE unViaAlgT #-}

mapViaAlgT :: forall s e t m n a b
            . RepresentationalT t
           => (t m a -> t n b)
           -> t (ViaAlg s e m) a
           -> t (ViaAlg s e n) b
mapViaAlgT :: (t m a -> t n b) -> t (ViaAlg s e m) a -> t (ViaAlg s e n) b
mapViaAlgT = (t m a -> t n b) -> t (ViaAlg s e m) a -> t (ViaAlg s e n) b
coerce
{-# INLINE mapViaAlgT #-}

mapUnViaAlgT :: forall s e t m n a b
             . RepresentationalT t
             => (t (ViaAlg s e m) a -> t (ViaAlg s e n) b)
             -> t m a
             -> t n b
mapUnViaAlgT :: (t (ViaAlg s e m) a -> t (ViaAlg s e n) b) -> t m a -> t n b
mapUnViaAlgT = (t (ViaAlg s e m) a -> t (ViaAlg s e n) b) -> t m a -> t n b
coerce
{-# INLINE mapUnViaAlgT #-}