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

Safe HaskellNone
LanguageHaskell2010

Servant.Utils.Enter

Contents

Synopsis

Documentation

class Enter typ arg ret | typ arg -> ret, typ ret -> arg where Source #

Minimal complete definition

enter

Methods

enter :: arg -> typ -> ret Source #

Instances

Enter (m a) ((:~>) * m n) (n a) Source # 

Methods

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

Enter b arg ret => Enter (a -> b) arg (a -> ret) Source # 

Methods

enter :: arg -> (a -> b) -> a -> ret Source #

(Enter typ1 arg1 ret1, Enter typ2 arg2 ret2, (~) * arg1 arg2) => Enter ((:<|>) typ1 typ2) arg1 ((:<|>) ret1 ret2) Source # 

Methods

enter :: arg1 -> (typ1 :<|> typ2) -> ret1 :<|> ret2 Source #

Servant combinators

Useful instances

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 strict 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 (k :~> f) g :: forall k. (k -> *) -> (k -> *) -> * infixr 0 #

A natural transformation suitable for storing in a container.

Constructors

NT 

Fields

Instances

Transformation k f g ((:~>) k f g) 

Methods

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

Enter (m a) ((:~>) * m n) (n a) Source # 

Methods

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

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

Methods

id :: cat a a #

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

(~) (k -> *) f g => Semigroup ((:~>) k f g) 

Methods

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

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

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

(~) (k -> *) f g => Monoid ((:~>) k f g) 

Methods

mempty :: (k :~> f) g #

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

mconcat :: [(k :~> f) g] -> (k :~> f) g #