Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Extras for working with servant
Synopsis
- noContent :: Functor m => m NoContent -> m ()
- useApi :: forall subapi api mode. GenericServant subapi mode => (api mode -> ToServant subapi mode) -> api mode -> subapi mode
- useApiE :: forall subapi api mode a. GenericServant (subapi a) mode => (api a mode -> ToServant (subapi a) mode) -> api a mode -> subapi a mode
- enterApi :: forall subapi api mode. GenericServant subapi mode => api mode -> (api mode -> ToServant subapi mode) -> subapi mode
- enterApiE :: forall subapi api mode a. GenericServant (subapi a) mode => api a mode -> (api a mode -> ToServant (subapi a) mode) -> subapi a mode
- type family Substitute (target :: k) subapi :: Type
- data Placeholder
Documentation
Generic
useApi :: forall subapi api mode. GenericServant subapi mode => (api mode -> ToServant subapi mode) -> api mode -> subapi mode Source #
Postcomposes fromServant
to an accessor,
preserving the mode parameter, because otherwise the mode parameter
can not be inferred.
Ideally, this functionality would be built into a new combinator.
useApiE :: forall subapi api mode a. GenericServant (subapi a) mode => (api a mode -> ToServant (subapi a) mode) -> api a mode -> subapi a mode Source #
Like useApi
but constrains the auth
type variable that's passed to
subapis.
enterApi :: forall subapi api mode. GenericServant subapi mode => api mode -> (api mode -> ToServant subapi mode) -> subapi mode Source #
@flip useApi
enterApiE :: forall subapi api mode a. GenericServant (subapi a) mode => api a mode -> (api a mode -> ToServant (subapi a) mode) -> subapi a mode Source #
@flip useApiE
Substitution
type family Substitute (target :: k) subapi :: Type Source #
Replaces Placeholder
by subapi
in the API target
.
Instances
type Substitute Placeholder subapi Source # | |
Defined in Hercules.API.Servant | |
type Substitute (a :<|> b :: Type) subapi Source # | |
Defined in Hercules.API.Servant | |
type Substitute (a :> b :: Type) subapi Source # | |
Defined in Hercules.API.Servant |
data Placeholder Source #
A reference to the subapi
parameter in Substitute
Instances
type Substitute Placeholder subapi Source # | |
Defined in Hercules.API.Servant |