servant-0.14.1: A family of combinators for defining webservices APIs

Safe HaskellNone
LanguageHaskell2010

Servant.Utils.Enter

Contents

Description

Deprecated: Use hoistServer or hoistServerWithContext from servant-server

Synopsis

Documentation

class (Entered m n typ ~ ret, Entered n m ret ~ typ) => Enter typ m n ret | typ m n -> ret, ret m n -> typ, ret typ m -> n, ret typ n -> m where Source #

Minimal complete definition

enter

Methods

enter :: (m :~> n) -> typ -> ret Source #

Map the leafs of an API type.

Instances
(Entered m n (m a) ~ n a, Entered n m (n a) ~ m a) => Enter (m a) m n (n a) Source # 
Instance details

Defined in Servant.Utils.Enter

Methods

enter :: (m :~> n) -> m a -> n a Source #

(Enter typ m n ret, Entered m n (a -> typ) ~ (a -> ret), Entered n m (a -> ret) ~ (a -> typ)) => Enter (a -> typ) m n (a -> ret) Source # 
Instance details

Defined in Servant.Utils.Enter

Methods

enter :: (m :~> n) -> (a -> typ) -> a -> ret Source #

(Enter typ1 m1 n1 ret1, Enter typ2 m2 n2 ret2, m1 ~ m2, n1 ~ n2, Entered m1 n1 (typ1 :<|> typ2) ~ (ret1 :<|> ret2), Entered n1 m1 (ret1 :<|> ret2) ~ (typ1 :<|> typ2)) => Enter (typ1 :<|> typ2) m1 n1 (ret1 :<|> ret2) Source # 
Instance details

Defined in Servant.Utils.Enter

Methods

enter :: (m1 :~> n1) -> (typ1 :<|> typ2) -> ret1 :<|> ret2 Source #

(Entered m n (Tagged m a) ~ Tagged n a, Entered n m (Tagged n a) ~ Tagged m a) => Enter (Tagged m a) m n (Tagged n a) Source # 
Instance details

Defined in Servant.Utils.Enter

Methods

enter :: (m :~> n) -> Tagged m a -> Tagged n a Source #

type family Entered m n api where ... Source #

Helper type family to state the Enter symmetry.

Equations

Entered m n (a -> api) = a -> Entered m n api 
Entered m n (m a) = n a 
Entered m n (api1 :<|> api2) = Entered m n api1 :<|> Entered m n api2 
Entered m n (Tagged m a) = Tagged n a 

liftNat :: (MonadTrans t, Monad m) => m :~> t m Source #

Like lift.

evalStateTLNat :: Monad m => s -> StateT s m :~> m Source #

evalStateTSNat :: Monad m => s -> StateT s m :~> m Source #

logWriterTSNat :: MonadIO m => (w -> IO ()) -> WriterT w m :~> m Source #

Log the contents of WriterT with the function provided as the first argument, and return the value of the WriterT computation

logWriterTLNat :: MonadIO m => (w -> IO ()) -> WriterT w m :~> m Source #

Like logWriterTSNat, but for lazy WriterT.

hoistNat :: (MFunctor t, Monad m) => (m :~> n) -> t m :~> t n Source #

Like mmorph's hoist.

embedNat :: (MMonad t, Monad n) => (m :~> t n) -> t m :~> t n Source #

Like mmorph's embed.

squashNat :: (Monad m, MMonad t) => t (t m) :~> t m Source #

Like mmorph's squash.

natural-transformation re-exports

newtype (f :: k -> *) :~> (g :: k -> *) :: forall k. (k -> *) -> (k -> *) -> * infixr 0 #

A natural transformation suitable for storing in a container.

Constructors

NT 

Fields

Instances
Transformation (f :: k -> *) (g :: k -> *) (f :~> g) 
Instance details

Defined in Control.Natural

Methods

(#) :: (f :~> g) -> forall (a :: k0). f a -> g a #

Category ((:~>) :: (k -> *) -> (k -> *) -> *) 
Instance details

Defined in Control.Natural

Methods

id :: a :~> a #

(.) :: (b :~> c) -> (a :~> b) -> a :~> c #

f ~ g => Semigroup (f :~> g) 
Instance details

Defined in Control.Natural

Methods

(<>) :: (f :~> g) -> (f :~> g) -> f :~> g #

sconcat :: NonEmpty (f :~> g) -> f :~> g #

stimes :: Integral b => b -> (f :~> g) -> f :~> g #

f ~ g => Monoid (f :~> g) 
Instance details

Defined in Control.Natural

Methods

mempty :: f :~> g #

mappend :: (f :~> g) -> (f :~> g) -> f :~> g #

mconcat :: [f :~> g] -> f :~> g #