| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Servant.To.Elm
Contents
Synopsis
- elmEndpointDefinition :: Expression Void -> Module -> Endpoint -> Definition
- class HasElmEndpoints api where
- elmEndpoints' :: Endpoint -> [Endpoint]
- elmEndpoints :: forall api. HasElmEndpoints api => [Endpoint]
- data Endpoint = Endpoint {}
- data PathSegment e
- data QueryParamType
- data URL = URL {
- _path :: [PathSegment Encoder]
- _queryString :: [(Text, QueryParamType, Encoder)]
- data Encoder = Encoder {}
- data Decoder = Decoder {}
- makeEncoder :: forall value a. HasElmEncoder value a => Encoder
- makeDecoder :: forall value a. HasElmDecoder value a => Decoder
Documentation
elmEndpointDefinition Source #
Arguments
| :: Expression Void | The URL base of the endpoint |
| -> Module | The module that the function should be generated into |
| -> Endpoint | A description of the endpoint |
| -> Definition |
Generate an Elm function for making a request to a Servant endpoint.
Endpoints
class HasElmEndpoints api where Source #
means that the Servant API HasElmEndpoints apiapi can be converted
to a list of Endpoints, which contains the information we need to generate
an Elm client library for the API.
Methods
elmEndpoints' :: Endpoint -> [Endpoint] Source #
Instances
elmEndpoints :: forall api. HasElmEndpoints api => [Endpoint] Source #
Convert an API to a list of Elm endpoint descriptors, Endpoint.
Usage: elmEndpoints @MyAPI
Contains the information we need about an endpoint to generate an Elm definition that calls it.
data PathSegment e Source #
Instances
| Show e => Show (PathSegment e) Source # | |
Defined in Servant.To.Elm Methods showsPrec :: Int -> PathSegment e -> ShowS # show :: PathSegment e -> String # showList :: [PathSegment e] -> ShowS # | |
data QueryParamType Source #
Instances
| Show QueryParamType Source # | |
Defined in Servant.To.Elm Methods showsPrec :: Int -> QueryParamType -> ShowS # show :: QueryParamType -> String # showList :: [QueryParamType] -> ShowS # | |
Constructors
| URL | |
Fields
| |
Constructors
| Encoder | |
Fields
| |
Constructors
| Decoder | |
Fields
| |
makeEncoder :: forall value a. HasElmEncoder value a => Encoder Source #
makeDecoder :: forall value a. HasElmDecoder value a => Decoder Source #
Orphan instances
| HasElmType NoContent Source # | |
| HasElmDefinition NoContent Source # | |
Methods | |
| HasElmDecoder Value NoContent Source # | |
Methods elmDecoder :: Expression v # | |