module Control.Effect.Internal.Utils
  ( Type,
    module Control.Effect.Internal.Utils
  ) where

import Data.Coerce
import Data.Kind (Type)

infixr 9 #.
(#.) :: Coercible c b => (b -> c) -> (a -> b) -> (a -> c)
#. :: (b -> c) -> (a -> b) -> a -> c
(#.) b -> c
_ = (a -> b) -> a -> c
coerce
{-# INLINE (#.) #-}

infixl 8 .#
(.#) :: Coercible b a => (b -> c) -> (a -> b) -> (a -> c)
.# :: (b -> c) -> (a -> b) -> a -> c
(.#) b -> c
pbc a -> b
_ = (b -> c) -> a -> c
coerce b -> c
pbc
{-# INLINE (.#) #-}

coerceTrans :: (Coercible m z, Coercible n y) => (m a -> n b) -> z a -> y b
coerceTrans :: (m a -> n b) -> z a -> y b
coerceTrans = (m a -> n b) -> z a -> y b
coerce
{-# INLINE coerceTrans #-}

coerceM :: Coercible m n => m a -> n a
coerceM :: m a -> n a
coerceM = m a -> n a
coerce
{-# INLINE coerceM #-}