servant-server-0.20.2: A family of combinators for defining webservices APIs and serving them
Safe HaskellNone
LanguageHaskell2010

Servant

Synopsis

Documentation

This module and its submodules can be used to define servant APIs. Note that these API definitions don't directly implement a server (or anything else).

data UVerb (method :: StdMethod) (contentTypes :: [Type]) (as :: [Type]) #

Instances

Instances details
HasLink (UVerb m ct a :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a0) -> Proxy (UVerb m ct a) -> Link -> MkLink (UVerb m ct a) a0 #

(ReflectMethod method, AllMime contentTypes, All (IsServerResourceWithStatus contentTypes) as, Unique (Statuses as)) => HasServer (UVerb method contentTypes as :: Type) context Source # 
Instance details

Defined in Servant.Server.UVerb

Methods

route :: Proxy (UVerb method contentTypes as) -> Context context -> Delayed env (Server (UVerb method contentTypes as)) -> Router env Source #

hoistServerWithContext :: Proxy (UVerb method contentTypes as) -> Proxy context -> (forall x. m x -> n x) -> ServerT (UVerb method contentTypes as) m -> ServerT (UVerb method contentTypes as) n Source #

AtMostOneFragment (UVerb m cts as) 
Instance details

Defined in Servant.API.TypeLevel

type MkLink (UVerb m ct a :: Type) r 
Instance details

Defined in Servant.Links

type MkLink (UVerb m ct a :: Type) r = r
type ServerT (UVerb method contentTypes as :: Type) m Source # 
Instance details

Defined in Servant.Server.UVerb

type ServerT (UVerb method contentTypes as :: Type) m = m (Union as)

data (path :: k) :> a #

Instances

Instances details
(TypeError (PartialApplication (HasLink :: Type -> Constraint) arr) :: Constraint) => HasLink (arr :> sub :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a0) -> Proxy (arr :> sub) -> Link -> MkLink (arr :> sub) a0 #

(KnownSymbol sym, HasLink sub) => HasLink (sym :> sub :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a) -> Proxy (sym :> sub) -> Link -> MkLink (sym :> sub) a #

HasLink sub => HasLink (HttpVersion :> sub :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a) -> Proxy (HttpVersion :> sub) -> Link -> MkLink (HttpVersion :> sub) a #

HasLink sub => HasLink (BasicAuth realm a :> sub :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a0) -> Proxy (BasicAuth realm a :> sub) -> Link -> MkLink (BasicAuth realm a :> sub) a0 #

(ToHttpApiData v, HasLink sub) => HasLink (Capture' mods sym v :> sub :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a) -> Proxy (Capture' mods sym v :> sub) -> Link -> MkLink (Capture' mods sym v :> sub) a #

(ToHttpApiData v, HasLink sub) => HasLink (CaptureAll sym v :> sub :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a) -> Proxy (CaptureAll sym v :> sub) -> Link -> MkLink (CaptureAll sym v :> sub) a #

HasLink sub => HasLink (Description s :> sub :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a) -> Proxy (Description s :> sub) -> Link -> MkLink (Description s :> sub) a #

HasLink sub => HasLink (Summary s :> sub :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a) -> Proxy (Summary s :> sub) -> Link -> MkLink (Summary s :> sub) a #

HasLink sub => HasLink (AuthProtect tag :> sub :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a) -> Proxy (AuthProtect tag :> sub) -> Link -> MkLink (AuthProtect tag :> sub) a #

(HasLink sub, ToHttpApiData v) => HasLink (Fragment v :> sub :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a) -> Proxy (Fragment v :> sub) -> Link -> MkLink (Fragment v :> sub) a #

HasLink sub => HasLink (Header' mods sym a :> sub :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a0) -> Proxy (Header' mods sym a :> sub) -> Link -> MkLink (Header' mods sym a :> sub) a0 #

HasLink sub => HasLink (IsSecure :> sub :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a) -> Proxy (IsSecure :> sub) -> Link -> MkLink (IsSecure :> sub) a #

(KnownSymbol sym, HasLink sub) => HasLink (QueryFlag sym :> sub :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a) -> Proxy (QueryFlag sym :> sub) -> Link -> MkLink (QueryFlag sym :> sub) a #

(KnownSymbol sym, ToHttpApiData v, HasLink sub, SBoolI (FoldRequired mods)) => HasLink (QueryParam' mods sym v :> sub :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a) -> Proxy (QueryParam' mods sym v :> sub) -> Link -> MkLink (QueryParam' mods sym v :> sub) a #

(KnownSymbol sym, ToHttpApiData v, HasLink sub) => HasLink (QueryParams sym v :> sub :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a) -> Proxy (QueryParams sym v :> sub) -> Link -> MkLink (QueryParams sym v :> sub) a #

HasLink sub => HasLink (RemoteHost :> sub :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a) -> Proxy (RemoteHost :> sub) -> Link -> MkLink (RemoteHost :> sub) a #

HasLink sub => HasLink (ReqBody' mods ct a :> sub :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a0) -> Proxy (ReqBody' mods ct a :> sub) -> Link -> MkLink (ReqBody' mods ct a :> sub) a0 #

HasLink sub => HasLink (StreamBody' mods framing ct a :> sub :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a0) -> Proxy (StreamBody' mods framing ct a :> sub) -> Link -> MkLink (StreamBody' mods framing ct a :> sub) a0 #

HasLink sub => HasLink (WithResource res :> sub :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a) -> Proxy (WithResource res :> sub) -> Link -> MkLink (WithResource res :> sub) a #

HasLink sub => HasLink (Vault :> sub :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a) -> Proxy (Vault :> sub) -> Link -> MkLink (Vault :> sub) a #

(TypeError (NoInstanceForSub (HasLink :: Type -> Constraint) ty) :: Constraint) => HasLink (ty :> sub :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a) -> Proxy (ty :> sub) -> Link -> MkLink (ty :> sub) a #

(TypeError (PartialApplication (HasServer :: Type -> [Type] -> Constraint) arr) :: Constraint) => HasServer (arr :> sub :: Type) context Source # 
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (arr :> sub) -> Context context -> Delayed env (Server (arr :> sub)) -> Router env Source #

hoistServerWithContext :: Proxy (arr :> sub) -> Proxy context -> (forall x. m x -> n x) -> ServerT (arr :> sub) m -> ServerT (arr :> sub) n Source #

(KnownSymbol path, HasServer api context) => HasServer (path :> api :: Type) context Source #

Make sure the incoming request starts with "/path", strip it and pass the rest of the request path to api.

Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (path :> api) -> Context context -> Delayed env (Server (path :> api)) -> Router env Source #

hoistServerWithContext :: Proxy (path :> api) -> Proxy context -> (forall x. m x -> n x) -> ServerT (path :> api) m -> ServerT (path :> api) n Source #

HasServer api context => HasServer (HttpVersion :> api :: Type) context Source # 
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (HttpVersion :> api) -> Context context -> Delayed env (Server (HttpVersion :> api)) -> Router env Source #

hoistServerWithContext :: Proxy (HttpVersion :> api) -> Proxy context -> (forall x. m x -> n x) -> ServerT (HttpVersion :> api) m -> ServerT (HttpVersion :> api) n Source #

(KnownSymbol realm, HasServer api context, HasContextEntry context (BasicAuthCheck usr)) => HasServer (BasicAuth realm usr :> api :: Type) context Source #

Basic Authentication

Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (BasicAuth realm usr :> api) -> Context context -> Delayed env (Server (BasicAuth realm usr :> api)) -> Router env Source #

hoistServerWithContext :: Proxy (BasicAuth realm usr :> api) -> Proxy context -> (forall x. m x -> n x) -> ServerT (BasicAuth realm usr :> api) m -> ServerT (BasicAuth realm usr :> api) n Source #

(KnownSymbol capture, FromHttpApiData a, Typeable a, HasServer api context, SBoolI (FoldLenient mods), HasContextEntry (MkContextWithErrorFormatter context) ErrorFormatters) => HasServer (Capture' mods capture a :> api :: Type) context Source #

If you use Capture in one of the endpoints for your API, this automatically requires your server-side handler to be a function that takes an argument of the type specified by the Capture. This lets servant worry about getting it from the URL and turning it into a value of the type you specify.

You can control how it'll be converted from Text to your type by simply providing an instance of FromHttpApiData for your type.

Example:

type MyApi = "books" :> Capture "isbn" Text :> Get '[JSON] Book

server :: Server MyApi
server = getBook
  where getBook :: Text -> Handler Book
        getBook isbn = ...
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (Capture' mods capture a :> api) -> Context context -> Delayed env (Server (Capture' mods capture a :> api)) -> Router env Source #

hoistServerWithContext :: Proxy (Capture' mods capture a :> api) -> Proxy context -> (forall x. m x -> n x) -> ServerT (Capture' mods capture a :> api) m -> ServerT (Capture' mods capture a :> api) n Source #

(KnownSymbol capture, FromHttpApiData a, Typeable a, HasServer api context, HasContextEntry (MkContextWithErrorFormatter context) ErrorFormatters) => HasServer (CaptureAll capture a :> api :: Type) context Source #

If you use CaptureAll in one of the endpoints for your API, this automatically requires your server-side handler to be a function that takes an argument of a list of the type specified by the CaptureAll. This lets servant worry about getting values from the URL and turning them into values of the type you specify.

You can control how they'll be converted from Text to your type by simply providing an instance of FromHttpApiData for your type.

Example:

type MyApi = "src" :> CaptureAll "segments" Text :> Get '[JSON] SourceFile

server :: Server MyApi
server = getSourceFile
  where getSourceFile :: [Text] -> Handler Book
        getSourceFile pathSegments = ...
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (CaptureAll capture a :> api) -> Context context -> Delayed env (Server (CaptureAll capture a :> api)) -> Router env Source #

hoistServerWithContext :: Proxy (CaptureAll capture a :> api) -> Proxy context -> (forall x. m x -> n x) -> ServerT (CaptureAll capture a :> api) m -> ServerT (CaptureAll capture a :> api) n Source #

HasServer api ctx => HasServer (Description desc :> api :: Type) ctx Source #

Ignore Description in server handlers.

Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (Description desc :> api) -> Context ctx -> Delayed env (Server (Description desc :> api)) -> Router env Source #

hoistServerWithContext :: Proxy (Description desc :> api) -> Proxy ctx -> (forall x. m x -> n x) -> ServerT (Description desc :> api) m -> ServerT (Description desc :> api) n Source #

HasServer api ctx => HasServer (Summary desc :> api :: Type) ctx Source #

Ignore Summary in server handlers.

Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (Summary desc :> api) -> Context ctx -> Delayed env (Server (Summary desc :> api)) -> Router env Source #

hoistServerWithContext :: Proxy (Summary desc :> api) -> Proxy ctx -> (forall x. m x -> n x) -> ServerT (Summary desc :> api) m -> ServerT (Summary desc :> api) n Source #

HasServer api context => HasServer (EmptyAPI :> api :: Type) context Source #

Ignore EmptyAPI as part of route in server handlers.

Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (EmptyAPI :> api) -> Context context -> Delayed env (Server (EmptyAPI :> api)) -> Router env Source #

hoistServerWithContext :: Proxy (EmptyAPI :> api) -> Proxy context -> (forall x. m x -> n x) -> ServerT (EmptyAPI :> api) m -> ServerT (EmptyAPI :> api) n Source #

(HasServer api context, HasContextEntry context (AuthHandler Request (AuthServerData (AuthProtect tag)))) => HasServer (AuthProtect tag :> api :: Type) context Source #

Known orphan instance.

Instance details

Defined in Servant.Server.Experimental.Auth

Methods

route :: Proxy (AuthProtect tag :> api) -> Context context -> Delayed env (Server (AuthProtect tag :> api)) -> Router env Source #

hoistServerWithContext :: Proxy (AuthProtect tag :> api) -> Proxy context -> (forall x. m x -> n x) -> ServerT (AuthProtect tag :> api) m -> ServerT (AuthProtect tag :> api) n Source #

(AtMostOneFragment api, FragmentUnique (Fragment a1 :> api), HasServer api context) => HasServer (Fragment a1 :> api :: Type) context Source #

Ignore Fragment in server handlers. See https://ietf.org/rfc/rfc2616.html#section-15.1.3 for more details.

Example:

type MyApi = "books" :> Fragment Text :> Get '[JSON] [Book]

server :: Server MyApi
server = getBooks
  where getBooks :: Handler [Book]
        getBooks = ...return all books...
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (Fragment a1 :> api) -> Context context -> Delayed env (Server (Fragment a1 :> api)) -> Router env Source #

hoistServerWithContext :: Proxy (Fragment a1 :> api) -> Proxy context -> (forall x. m x -> n x) -> ServerT (Fragment a1 :> api) m -> ServerT (Fragment a1 :> api) n Source #

(KnownSymbol sym, FromHttpApiData a, HasServer api context, SBoolI (FoldRequired mods), SBoolI (FoldLenient mods), HasContextEntry (MkContextWithErrorFormatter context) ErrorFormatters) => HasServer (Header' mods sym a :> api :: Type) context Source #

If you use Header in one of the endpoints for your API, this automatically requires your server-side handler to be a function that takes an argument of the type specified by Header. This lets servant worry about extracting it from the request and turning it into a value of the type you specify.

All it asks is for a FromHttpApiData instance.

Example:

newtype Referer = Referer Text
  deriving (Eq, Show, FromHttpApiData)

           -- GET /view-my-referer
type MyApi = "view-my-referer" :> Header "Referer" Referer :> Get '[JSON] Referer

server :: Server MyApi
server = viewReferer
  where viewReferer :: Referer -> Handler referer
        viewReferer referer = return referer
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (Header' mods sym a :> api) -> Context context -> Delayed env (Server (Header' mods sym a :> api)) -> Router env Source #

hoistServerWithContext :: Proxy (Header' mods sym a :> api) -> Proxy context -> (forall x. m x -> n x) -> ServerT (Header' mods sym a :> api) m -> ServerT (Header' mods sym a :> api) n Source #

HasServer api context => HasServer (IsSecure :> api :: Type) context Source # 
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (IsSecure :> api) -> Context context -> Delayed env (Server (IsSecure :> api)) -> Router env Source #

hoistServerWithContext :: Proxy (IsSecure :> api) -> Proxy context -> (forall x. m x -> n x) -> ServerT (IsSecure :> api) m -> ServerT (IsSecure :> api) n Source #

(KnownSymbol sym, HasServer api context) => HasServer (QueryFlag sym :> api :: Type) context Source #

If you use QueryFlag "published" in one of the endpoints for your API, this automatically requires your server-side handler to be a function that takes an argument of type Bool.

Example:

type MyApi = "books" :> QueryFlag "published" :> Get '[JSON] [Book]

server :: Server MyApi
server = getBooks
  where getBooks :: Bool -> Handler [Book]
        getBooks onlyPublished = ...return all books, or only the ones that are already published, depending on the argument...
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (QueryFlag sym :> api) -> Context context -> Delayed env (Server (QueryFlag sym :> api)) -> Router env Source #

hoistServerWithContext :: Proxy (QueryFlag sym :> api) -> Proxy context -> (forall x. m x -> n x) -> ServerT (QueryFlag sym :> api) m -> ServerT (QueryFlag sym :> api) n Source #

(KnownSymbol sym, FromHttpApiData a, HasServer api context, SBoolI (FoldRequired mods), SBoolI (FoldLenient mods), HasContextEntry (MkContextWithErrorFormatter context) ErrorFormatters) => HasServer (QueryParam' mods sym a :> api :: Type) context Source #

If you use QueryParam "author" Text in one of the endpoints for your API, this automatically requires your server-side handler to be a function that takes an argument of type Maybe Text.

This lets servant worry about looking it up in the query string and turning it into a value of the type you specify, enclosed in Maybe, because it may not be there and servant would then hand you Nothing.

You can control how it'll be converted from Text to your type by simply providing an instance of FromHttpApiData for your type.

Example:

type MyApi = "books" :> QueryParam "author" Text :> Get '[JSON] [Book]

server :: Server MyApi
server = getBooksBy
  where getBooksBy :: Maybe Text -> Handler [Book]
        getBooksBy Nothing       = ...return all books...
        getBooksBy (Just author) = ...return books by the given author...
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (QueryParam' mods sym a :> api) -> Context context -> Delayed env (Server (QueryParam' mods sym a :> api)) -> Router env Source #

hoistServerWithContext :: Proxy (QueryParam' mods sym a :> api) -> Proxy context -> (forall x. m x -> n x) -> ServerT (QueryParam' mods sym a :> api) m -> ServerT (QueryParam' mods sym a :> api) n Source #

(KnownSymbol sym, FromHttpApiData a, HasServer api context, HasContextEntry (MkContextWithErrorFormatter context) ErrorFormatters) => HasServer (QueryParams sym a :> api :: Type) context Source #

If you use QueryParams "authors" Text in one of the endpoints for your API, this automatically requires your server-side handler to be a function that takes an argument of type [Text].

This lets servant worry about looking up 0 or more values in the query string associated to authors and turning each of them into a value of the type you specify.

You can control how the individual values are converted from Text to your type by simply providing an instance of FromHttpApiData for your type.

Example:

type MyApi = "books" :> QueryParams "authors" Text :> Get '[JSON] [Book]

server :: Server MyApi
server = getBooksBy
  where getBooksBy :: [Text] -> Handler [Book]
        getBooksBy authors = ...return all books by these authors...
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (QueryParams sym a :> api) -> Context context -> Delayed env (Server (QueryParams sym a :> api)) -> Router env Source #

hoistServerWithContext :: Proxy (QueryParams sym a :> api) -> Proxy context -> (forall x. m x -> n x) -> ServerT (QueryParams sym a :> api) m -> ServerT (QueryParams sym a :> api) n Source #

(KnownSymbol sym, FromDeepQuery a, HasServer api context, HasContextEntry (MkContextWithErrorFormatter context) ErrorFormatters) => HasServer (DeepQuery sym a :> api :: Type) context Source #

If you use DeepQuery "symbol" a in one of the endpoints for your API, this automatically requires your server-side handler to be a function that takes an argument of type a.

This lets you extract an object from multiple parameters in the query string, with its fields enclosed in brackets: `/books?filter[author][name]=value`. When all the fields are known in advance, it can be done with QueryParam (it can still be tedious if you the object has many fields). When some fields are dynamic, it cannot be done with @QueryParam.

The way the object is constructed from the extracted fields can be controlled by providing an instance on FromDeepQuery

Example:

type MyApi = "books" :> DeepQuery "filter" BookQuery :> Get '[JSON] [Book]

server :: Server MyApi
server = getBooksBy
  where getBooksBy :: BookQuery -> Handler [Book]
        getBooksBy query = ...filter books based on the dynamic filters provided...
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (DeepQuery sym a :> api) -> Context context -> Delayed env (Server (DeepQuery sym a :> api)) -> Router env Source #

hoistServerWithContext :: Proxy (DeepQuery sym a :> api) -> Proxy context -> (forall x. m x -> n x) -> ServerT (DeepQuery sym a :> api) m -> ServerT (DeepQuery sym a :> api) n Source #

HasServer api context => HasServer (QueryString :> api :: Type) context Source #

If you use QueryString in one of the endpoints for your API, this automatically requires your server-side handler to be a function that takes an argument of type Query ([(ByteString, Maybe ByteString)]).

This lets you extract the whole query string. This is useful when the query string can contain parameters with dynamic names, that you can't access with QueryParam.

Example:

type MyApi = "books" :> QueryString :> Get '[JSON] [Book]

server :: Server MyApi
server = getBooksBy
  where getBooksBy :: Query -> Handler [Book]
        getBooksBy filters = ...filter books based on the dynamic filters provided...
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (QueryString :> api) -> Context context -> Delayed env (Server (QueryString :> api)) -> Router env Source #

hoistServerWithContext :: Proxy (QueryString :> api) -> Proxy context -> (forall x. m x -> n x) -> ServerT (QueryString :> api) m -> ServerT (QueryString :> api) n Source #

HasServer api context => HasServer (RemoteHost :> api :: Type) context Source # 
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (RemoteHost :> api) -> Context context -> Delayed env (Server (RemoteHost :> api)) -> Router env Source #

hoistServerWithContext :: Proxy (RemoteHost :> api) -> Proxy context -> (forall x. m x -> n x) -> ServerT (RemoteHost :> api) m -> ServerT (RemoteHost :> api) n Source #

(AllCTUnrender list a, HasServer api context, SBoolI (FoldLenient mods), HasContextEntry (MkContextWithErrorFormatter context) ErrorFormatters) => HasServer (ReqBody' mods list a :> api :: Type) context Source #

If you use ReqBody in one of the endpoints for your API, this automatically requires your server-side handler to be a function that takes an argument of the type specified by ReqBody. The Content-Type header is inspected, and the list provided is used to attempt deserialization. If the request does not have a Content-Type header, it is treated as application/octet-stream (as specified in RFC 7231 section 3.1.1.5). This lets servant worry about extracting it from the request and turning it into a value of the type you specify.

All it asks is for a FromJSON instance.

Example:

type MyApi = "books" :> ReqBody '[JSON] Book :> Post '[JSON] Book

server :: Server MyApi
server = postBook
  where postBook :: Book -> Handler Book
        postBook book = ...insert into your db...
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (ReqBody' mods list a :> api) -> Context context -> Delayed env (Server (ReqBody' mods list a :> api)) -> Router env Source #

hoistServerWithContext :: Proxy (ReqBody' mods list a :> api) -> Proxy context -> (forall x. m x -> n x) -> ServerT (ReqBody' mods list a :> api) m -> ServerT (ReqBody' mods list a :> api) n Source #

(FramingUnrender framing, FromSourceIO chunk a, MimeUnrender ctype chunk, HasServer api context) => HasServer (StreamBody' mods framing ctype a :> api :: Type) context Source # 
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (StreamBody' mods framing ctype a :> api) -> Context context -> Delayed env (Server (StreamBody' mods framing ctype a :> api)) -> Router env Source #

hoistServerWithContext :: Proxy (StreamBody' mods framing ctype a :> api) -> Proxy context -> (forall x. m x -> n x) -> ServerT (StreamBody' mods framing ctype a :> api) m -> ServerT (StreamBody' mods framing ctype a :> api) n Source #

(HasServer api ctx, HasContextEntry ctx (Acquire a)) => HasServer (WithResource a :> api :: Type) ctx Source #

If you use WithResource in one of the endpoints for your API Servant will provide the handler for this endpoint an argument of the specified type. The lifespan of this resource will be automatically managed by Servant. This resource will be created before the handler starts and it will be destoyed after it ends. A new resource is created for each request to the endpoint.

Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (WithResource a :> api) -> Context ctx -> Delayed env (Server (WithResource a :> api)) -> Router env Source #

hoistServerWithContext :: Proxy (WithResource a :> api) -> Proxy ctx -> (forall x. m x -> n x) -> ServerT (WithResource a :> api) m -> ServerT (WithResource a :> api) n Source #

HasServer api context => HasServer (Vault :> api :: Type) context Source # 
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (Vault :> api) -> Context context -> Delayed env (Server (Vault :> api)) -> Router env Source #

hoistServerWithContext :: Proxy (Vault :> api) -> Proxy context -> (forall x. m x -> n x) -> ServerT (Vault :> api) m -> ServerT (Vault :> api) n Source #

(TypeError (NoInstanceForSub (HasServer :: Type -> [Type] -> Constraint) ty) :: Constraint) => HasServer (ty :> sub :: Type) context Source # 
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (ty :> sub) -> Context context -> Delayed env (Server (ty :> sub)) -> Router env Source #

hoistServerWithContext :: Proxy (ty :> sub) -> Proxy context -> (forall x. m x -> n x) -> ServerT (ty :> sub) m -> ServerT (ty :> sub) n Source #

type MkLink (arr :> sub :: Type) _1 
Instance details

Defined in Servant.Links

type MkLink (arr :> sub :: Type) _1 = TypeError (PartialApplication (HasLink :: Type -> Constraint) arr) :: Type
type MkLink (sym :> sub :: Type) a 
Instance details

Defined in Servant.Links

type MkLink (sym :> sub :: Type) a = MkLink sub a
type MkLink (HttpVersion :> sub :: Type) a 
Instance details

Defined in Servant.Links

type MkLink (HttpVersion :> sub :: Type) a = MkLink sub a
type MkLink (BasicAuth realm a :> sub :: Type) r 
Instance details

Defined in Servant.Links

type MkLink (BasicAuth realm a :> sub :: Type) r = MkLink sub r
type MkLink (Capture' mods sym v :> sub :: Type) a 
Instance details

Defined in Servant.Links

type MkLink (Capture' mods sym v :> sub :: Type) a = v -> MkLink sub a
type MkLink (CaptureAll sym v :> sub :: Type) a 
Instance details

Defined in Servant.Links

type MkLink (CaptureAll sym v :> sub :: Type) a = [v] -> MkLink sub a
type MkLink (Description s :> sub :: Type) a 
Instance details

Defined in Servant.Links

type MkLink (Description s :> sub :: Type) a = MkLink sub a
type MkLink (Summary s :> sub :: Type) a 
Instance details

Defined in Servant.Links

type MkLink (Summary s :> sub :: Type) a = MkLink sub a
type MkLink (AuthProtect tag :> sub :: Type) a 
Instance details

Defined in Servant.Links

type MkLink (AuthProtect tag :> sub :: Type) a = MkLink sub a
type MkLink (Fragment v :> sub :: Type) a 
Instance details

Defined in Servant.Links

type MkLink (Fragment v :> sub :: Type) a = v -> MkLink sub a
type MkLink (Header' mods sym a :> sub :: Type) r 
Instance details

Defined in Servant.Links

type MkLink (Header' mods sym a :> sub :: Type) r = MkLink sub r
type MkLink (IsSecure :> sub :: Type) a 
Instance details

Defined in Servant.Links

type MkLink (IsSecure :> sub :: Type) a = MkLink sub a
type MkLink (QueryFlag sym :> sub :: Type) a 
Instance details

Defined in Servant.Links

type MkLink (QueryFlag sym :> sub :: Type) a = Bool -> MkLink sub a
type MkLink (QueryParam' mods sym v :> sub :: Type) a 
Instance details

Defined in Servant.Links

type MkLink (QueryParam' mods sym v :> sub :: Type) a = If (FoldRequired mods) v (Maybe v) -> MkLink sub a
type MkLink (QueryParams sym v :> sub :: Type) a 
Instance details

Defined in Servant.Links

type MkLink (QueryParams sym v :> sub :: Type) a = [v] -> MkLink sub a
type MkLink (RemoteHost :> sub :: Type) a 
Instance details

Defined in Servant.Links

type MkLink (RemoteHost :> sub :: Type) a = MkLink sub a
type MkLink (ReqBody' mods ct a :> sub :: Type) r 
Instance details

Defined in Servant.Links

type MkLink (ReqBody' mods ct a :> sub :: Type) r = MkLink sub r
type MkLink (StreamBody' mods framing ct a :> sub :: Type) r 
Instance details

Defined in Servant.Links

type MkLink (StreamBody' mods framing ct a :> sub :: Type) r = MkLink sub r
type MkLink (WithResource res :> sub :: Type) a 
Instance details

Defined in Servant.Links

type MkLink (WithResource res :> sub :: Type) a = MkLink sub a
type MkLink (Vault :> sub :: Type) a 
Instance details

Defined in Servant.Links

type MkLink (Vault :> sub :: Type) a = MkLink sub a
type ServerT (arr :> sub :: Type) _1 Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (arr :> sub :: Type) _1 = TypeError (PartialApplication (HasServer :: Type -> [Type] -> Constraint) arr) :: Type
type ServerT (path :> api :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (path :> api :: Type) m = ServerT api m
type ServerT (HttpVersion :> api :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (HttpVersion :> api :: Type) m = HttpVersion -> ServerT api m
type ServerT (BasicAuth realm usr :> api :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (BasicAuth realm usr :> api :: Type) m = usr -> ServerT api m
type ServerT (Capture' mods capture a :> api :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (Capture' mods capture a :> api :: Type) m = If (FoldLenient mods) (Either String a) a -> ServerT api m
type ServerT (CaptureAll capture a :> api :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (CaptureAll capture a :> api :: Type) m = [a] -> ServerT api m
type ServerT (Description desc :> api :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (Description desc :> api :: Type) m = ServerT api m
type ServerT (Summary desc :> api :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (Summary desc :> api :: Type) m = ServerT api m
type ServerT (EmptyAPI :> api :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (EmptyAPI :> api :: Type) m = ServerT api m
type ServerT (AuthProtect tag :> api :: Type) m Source # 
Instance details

Defined in Servant.Server.Experimental.Auth

type ServerT (AuthProtect tag :> api :: Type) m = AuthServerData (AuthProtect tag) -> ServerT api m
type ServerT (Fragment a1 :> api :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (Fragment a1 :> api :: Type) m = ServerT api m
type ServerT (Header' mods sym a :> api :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (Header' mods sym a :> api :: Type) m = RequestArgument mods a -> ServerT api m
type ServerT (IsSecure :> api :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (IsSecure :> api :: Type) m = IsSecure -> ServerT api m
type ServerT (QueryFlag sym :> api :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (QueryFlag sym :> api :: Type) m = Bool -> ServerT api m
type ServerT (QueryParam' mods sym a :> api :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (QueryParam' mods sym a :> api :: Type) m = RequestArgument mods a -> ServerT api m
type ServerT (QueryParams sym a :> api :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (QueryParams sym a :> api :: Type) m = [a] -> ServerT api m
type ServerT (DeepQuery sym a :> api :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (DeepQuery sym a :> api :: Type) m = a -> ServerT api m
type ServerT (QueryString :> api :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (QueryString :> api :: Type) m = Query -> ServerT api m
type ServerT (RemoteHost :> api :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (RemoteHost :> api :: Type) m = SockAddr -> ServerT api m
type ServerT (ReqBody' mods list a :> api :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (ReqBody' mods list a :> api :: Type) m = If (FoldLenient mods) (Either String a) a -> ServerT api m
type ServerT (StreamBody' mods framing ctype a :> api :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (StreamBody' mods framing ctype a :> api :: Type) m = a -> ServerT api m
type ServerT (WithResource a :> api :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (WithResource a :> api :: Type) m = (ReleaseKey, a) -> ServerT api m
type ServerT (Vault :> api :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (Vault :> api :: Type) m = Vault -> ServerT api m

data BasicAuth (realm :: Symbol) userData #

Instances

Instances details
HasLink sub => HasLink (BasicAuth realm a :> sub :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a0) -> Proxy (BasicAuth realm a :> sub) -> Link -> MkLink (BasicAuth realm a :> sub) a0 #

(KnownSymbol realm, HasServer api context, HasContextEntry context (BasicAuthCheck usr)) => HasServer (BasicAuth realm usr :> api :: Type) context Source #

Basic Authentication

Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (BasicAuth realm usr :> api) -> Context context -> Delayed env (Server (BasicAuth realm usr :> api)) -> Router env Source #

hoistServerWithContext :: Proxy (BasicAuth realm usr :> api) -> Proxy context -> (forall x. m x -> n x) -> ServerT (BasicAuth realm usr :> api) m -> ServerT (BasicAuth realm usr :> api) n Source #

type MkLink (BasicAuth realm a :> sub :: Type) r 
Instance details

Defined in Servant.Links

type MkLink (BasicAuth realm a :> sub :: Type) r = MkLink sub r
type ServerT (BasicAuth realm usr :> api :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (BasicAuth realm usr :> api :: Type) m = usr -> ServerT api m

data ResponseHeader (sym :: Symbol) a #

Constructors

Header a 
MissingHeader 
UndecodableHeader ByteString 

Instances

Instances details
Functor (ResponseHeader sym) 
Instance details

Defined in Servant.API.ResponseHeaders

Methods

fmap :: (a -> b) -> ResponseHeader sym a -> ResponseHeader sym b

(<$) :: a -> ResponseHeader sym b -> ResponseHeader sym a

NFData a => NFData (ResponseHeader sym a) 
Instance details

Defined in Servant.API.ResponseHeaders

Methods

rnf :: ResponseHeader sym a -> ()

Show a => Show (ResponseHeader sym a) 
Instance details

Defined in Servant.API.ResponseHeaders

Methods

showsPrec :: Int -> ResponseHeader sym a -> ShowS

show :: ResponseHeader sym a -> String

showList :: [ResponseHeader sym a] -> ShowS

Eq a => Eq (ResponseHeader sym a) 
Instance details

Defined in Servant.API.ResponseHeaders

Methods

(==) :: ResponseHeader sym a -> ResponseHeader sym a -> Bool

(/=) :: ResponseHeader sym a -> ResponseHeader sym a -> Bool

data a :<|> b #

Constructors

a :<|> b 

Instances

Instances details
Bifoldable (:<|>) 
Instance details

Defined in Servant.API.Alternative

Methods

bifold :: Monoid m => (m :<|> m) -> m

bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> (a :<|> b) -> m

bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> (a :<|> b) -> c

bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> (a :<|> b) -> c

Bifunctor (:<|>) 
Instance details

Defined in Servant.API.Alternative

Methods

bimap :: (a -> b) -> (c -> d) -> (a :<|> c) -> b :<|> d

first :: (a -> b) -> (a :<|> c) -> b :<|> c

second :: (b -> c) -> (a :<|> b) -> a :<|> c

Bitraversable (:<|>) 
Instance details

Defined in Servant.API.Alternative

Methods

bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> (a :<|> b) -> f (c :<|> d)

Biapplicative (:<|>) 
Instance details

Defined in Servant.API.Alternative

Methods

bipure :: a -> b -> a :<|> b

(<<*>>) :: ((a -> b) :<|> (c -> d)) -> (a :<|> c) -> b :<|> d

biliftA2 :: (a -> b -> c) -> (d -> e -> f) -> (a :<|> d) -> (b :<|> e) -> c :<|> f

(*>>) :: (a :<|> b) -> (c :<|> d) -> c :<|> d

(<<*) :: (a :<|> b) -> (c :<|> d) -> a :<|> b

(HasLink a, HasLink b) => HasLink (a :<|> b :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a0) -> Proxy (a :<|> b) -> Link -> MkLink (a :<|> b) a0 #

(HasServer a context, HasServer b context) => HasServer (a :<|> b :: Type) context Source #

A server for a :<|> b first tries to match the request against the route represented by a and if it fails tries b. You must provide a request handler for each route.

type MyApi = "books" :> Get '[JSON] [Book] -- GET /books
        :<|> "books" :> ReqBody Book :> Post '[JSON] Book -- POST /books

server :: Server MyApi
server = listAllBooks :<|> postBook
  where listAllBooks = ...
        postBook book = ...
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (a :<|> b) -> Context context -> Delayed env (Server (a :<|> b)) -> Router env Source #

hoistServerWithContext :: Proxy (a :<|> b) -> Proxy context -> (forall x. m x -> n x) -> ServerT (a :<|> b) m -> ServerT (a :<|> b) n Source #

Functor ((:<|>) a) 
Instance details

Defined in Servant.API.Alternative

Methods

fmap :: (a0 -> b) -> (a :<|> a0) -> a :<|> b

(<$) :: a0 -> (a :<|> b) -> a :<|> a0

Foldable ((:<|>) a) 
Instance details

Defined in Servant.API.Alternative

Methods

fold :: Monoid m => (a :<|> m) -> m

foldMap :: Monoid m => (a0 -> m) -> (a :<|> a0) -> m

foldMap' :: Monoid m => (a0 -> m) -> (a :<|> a0) -> m

foldr :: (a0 -> b -> b) -> b -> (a :<|> a0) -> b

foldr' :: (a0 -> b -> b) -> b -> (a :<|> a0) -> b

foldl :: (b -> a0 -> b) -> b -> (a :<|> a0) -> b

foldl' :: (b -> a0 -> b) -> b -> (a :<|> a0) -> b

foldr1 :: (a0 -> a0 -> a0) -> (a :<|> a0) -> a0

foldl1 :: (a0 -> a0 -> a0) -> (a :<|> a0) -> a0

toList :: (a :<|> a0) -> [a0]

null :: (a :<|> a0) -> Bool

length :: (a :<|> a0) -> Int

elem :: Eq a0 => a0 -> (a :<|> a0) -> Bool

maximum :: Ord a0 => (a :<|> a0) -> a0

minimum :: Ord a0 => (a :<|> a0) -> a0

sum :: Num a0 => (a :<|> a0) -> a0

product :: Num a0 => (a :<|> a0) -> a0

Traversable ((:<|>) a) 
Instance details

Defined in Servant.API.Alternative

Methods

traverse :: Applicative f => (a0 -> f b) -> (a :<|> a0) -> f (a :<|> b)

sequenceA :: Applicative f => (a :<|> f a0) -> f (a :<|> a0)

mapM :: Monad m => (a0 -> m b) -> (a :<|> a0) -> m (a :<|> b)

sequence :: Monad m => (a :<|> m a0) -> m (a :<|> a0)

(Monoid a, Monoid b) => Monoid (a :<|> b) 
Instance details

Defined in Servant.API.Alternative

Methods

mempty :: a :<|> b

mappend :: (a :<|> b) -> (a :<|> b) -> a :<|> b

mconcat :: [a :<|> b] -> a :<|> b

(Semigroup a, Semigroup b) => Semigroup (a :<|> b) 
Instance details

Defined in Servant.API.Alternative

Methods

(<>) :: (a :<|> b) -> (a :<|> b) -> a :<|> b

sconcat :: NonEmpty (a :<|> b) -> a :<|> b

stimes :: Integral b0 => b0 -> (a :<|> b) -> a :<|> b

(Bounded a, Bounded b) => Bounded (a :<|> b) 
Instance details

Defined in Servant.API.Alternative

Methods

minBound :: a :<|> b

maxBound :: a :<|> b

(Show a, Show b) => Show (a :<|> b) 
Instance details

Defined in Servant.API.Alternative

Methods

showsPrec :: Int -> (a :<|> b) -> ShowS

show :: (a :<|> b) -> String

showList :: [a :<|> b] -> ShowS

(Eq a, Eq b) => Eq (a :<|> b) 
Instance details

Defined in Servant.API.Alternative

Methods

(==) :: (a :<|> b) -> (a :<|> b) -> Bool

(/=) :: (a :<|> b) -> (a :<|> b) -> Bool

type MkLink (a :<|> b :: Type) r 
Instance details

Defined in Servant.Links

type MkLink (a :<|> b :: Type) r = MkLink a r :<|> MkLink b r
type ServerT (a :<|> b :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (a :<|> b :: Type) m = ServerT a m :<|> ServerT b m

class Accept (ctype :: k) where #

Minimal complete definition

contentType | contentTypes

Methods

contentType :: Proxy ctype -> MediaType #

contentTypes :: Proxy ctype -> NonEmpty MediaType #

Instances

Instances details
Accept FormUrlEncoded 
Instance details

Defined in Servant.API.ContentTypes

Methods

contentType :: Proxy FormUrlEncoded -> MediaType #

contentTypes :: Proxy FormUrlEncoded -> NonEmpty MediaType #

Accept JSON 
Instance details

Defined in Servant.API.ContentTypes

Methods

contentType :: Proxy JSON -> MediaType #

contentTypes :: Proxy JSON -> NonEmpty MediaType #

Accept OctetStream 
Instance details

Defined in Servant.API.ContentTypes

Methods

contentType :: Proxy OctetStream -> MediaType #

contentTypes :: Proxy OctetStream -> NonEmpty MediaType #

Accept PlainText 
Instance details

Defined in Servant.API.ContentTypes

Methods

contentType :: Proxy PlainText -> MediaType #

contentTypes :: Proxy PlainText -> NonEmpty MediaType #

data Capture' (mods :: [Type]) (sym :: Symbol) a #

Instances

Instances details
(ToHttpApiData v, HasLink sub) => HasLink (Capture' mods sym v :> sub :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a) -> Proxy (Capture' mods sym v :> sub) -> Link -> MkLink (Capture' mods sym v :> sub) a #

(KnownSymbol capture, FromHttpApiData a, Typeable a, HasServer api context, SBoolI (FoldLenient mods), HasContextEntry (MkContextWithErrorFormatter context) ErrorFormatters) => HasServer (Capture' mods capture a :> api :: Type) context Source #

If you use Capture in one of the endpoints for your API, this automatically requires your server-side handler to be a function that takes an argument of the type specified by the Capture. This lets servant worry about getting it from the URL and turning it into a value of the type you specify.

You can control how it'll be converted from Text to your type by simply providing an instance of FromHttpApiData for your type.

Example:

type MyApi = "books" :> Capture "isbn" Text :> Get '[JSON] Book

server :: Server MyApi
server = getBook
  where getBook :: Text -> Handler Book
        getBook isbn = ...
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (Capture' mods capture a :> api) -> Context context -> Delayed env (Server (Capture' mods capture a :> api)) -> Router env Source #

hoistServerWithContext :: Proxy (Capture' mods capture a :> api) -> Proxy context -> (forall x. m x -> n x) -> ServerT (Capture' mods capture a :> api) m -> ServerT (Capture' mods capture a :> api) n Source #

type MkLink (Capture' mods sym v :> sub :: Type) a 
Instance details

Defined in Servant.Links

type MkLink (Capture' mods sym v :> sub :: Type) a = v -> MkLink sub a
type ServerT (Capture' mods capture a :> api :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (Capture' mods capture a :> api :: Type) m = If (FoldLenient mods) (Either String a) a -> ServerT api m

data CaptureAll (sym :: Symbol) a #

Instances

Instances details
(ToHttpApiData v, HasLink sub) => HasLink (CaptureAll sym v :> sub :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a) -> Proxy (CaptureAll sym v :> sub) -> Link -> MkLink (CaptureAll sym v :> sub) a #

(KnownSymbol capture, FromHttpApiData a, Typeable a, HasServer api context, HasContextEntry (MkContextWithErrorFormatter context) ErrorFormatters) => HasServer (CaptureAll capture a :> api :: Type) context Source #

If you use CaptureAll in one of the endpoints for your API, this automatically requires your server-side handler to be a function that takes an argument of a list of the type specified by the CaptureAll. This lets servant worry about getting values from the URL and turning them into values of the type you specify.

You can control how they'll be converted from Text to your type by simply providing an instance of FromHttpApiData for your type.

Example:

type MyApi = "src" :> CaptureAll "segments" Text :> Get '[JSON] SourceFile

server :: Server MyApi
server = getSourceFile
  where getSourceFile :: [Text] -> Handler Book
        getSourceFile pathSegments = ...
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (CaptureAll capture a :> api) -> Context context -> Delayed env (Server (CaptureAll capture a :> api)) -> Router env Source #

hoistServerWithContext :: Proxy (CaptureAll capture a :> api) -> Proxy context -> (forall x. m x -> n x) -> ServerT (CaptureAll capture a :> api) m -> ServerT (CaptureAll capture a :> api) n Source #

type MkLink (CaptureAll sym v :> sub :: Type) a 
Instance details

Defined in Servant.Links

type MkLink (CaptureAll sym v :> sub :: Type) a = [v] -> MkLink sub a
type ServerT (CaptureAll capture a :> api :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (CaptureAll capture a :> api :: Type) m = [a] -> ServerT api m

data DeepQuery (sym :: Symbol) a #

Instances

Instances details
(KnownSymbol sym, FromDeepQuery a, HasServer api context, HasContextEntry (MkContextWithErrorFormatter context) ErrorFormatters) => HasServer (DeepQuery sym a :> api :: Type) context Source #

If you use DeepQuery "symbol" a in one of the endpoints for your API, this automatically requires your server-side handler to be a function that takes an argument of type a.

This lets you extract an object from multiple parameters in the query string, with its fields enclosed in brackets: `/books?filter[author][name]=value`. When all the fields are known in advance, it can be done with QueryParam (it can still be tedious if you the object has many fields). When some fields are dynamic, it cannot be done with @QueryParam.

The way the object is constructed from the extracted fields can be controlled by providing an instance on FromDeepQuery

Example:

type MyApi = "books" :> DeepQuery "filter" BookQuery :> Get '[JSON] [Book]

server :: Server MyApi
server = getBooksBy
  where getBooksBy :: BookQuery -> Handler [Book]
        getBooksBy query = ...filter books based on the dynamic filters provided...
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (DeepQuery sym a :> api) -> Context context -> Delayed env (Server (DeepQuery sym a :> api)) -> Router env Source #

hoistServerWithContext :: Proxy (DeepQuery sym a :> api) -> Proxy context -> (forall x. m x -> n x) -> ServerT (DeepQuery sym a :> api) m -> ServerT (DeepQuery sym a :> api) n Source #

type ServerT (DeepQuery sym a :> api :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (DeepQuery sym a :> api :: Type) m = a -> ServerT api m

data Description (sym :: Symbol) #

Instances

Instances details
HasLink sub => HasLink (Description s :> sub :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a) -> Proxy (Description s :> sub) -> Link -> MkLink (Description s :> sub) a #

HasServer api ctx => HasServer (Description desc :> api :: Type) ctx Source #

Ignore Description in server handlers.

Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (Description desc :> api) -> Context ctx -> Delayed env (Server (Description desc :> api)) -> Router env Source #

hoistServerWithContext :: Proxy (Description desc :> api) -> Proxy ctx -> (forall x. m x -> n x) -> ServerT (Description desc :> api) m -> ServerT (Description desc :> api) n Source #

type MkLink (Description s :> sub :: Type) a 
Instance details

Defined in Servant.Links

type MkLink (Description s :> sub :: Type) a = MkLink sub a
type ServerT (Description desc :> api :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (Description desc :> api :: Type) m = ServerT api m

data EmptyAPI #

Constructors

EmptyAPI 

Instances

Instances details
Bounded EmptyAPI 
Instance details

Defined in Servant.API.Empty

Enum EmptyAPI 
Instance details

Defined in Servant.API.Empty

Show EmptyAPI 
Instance details

Defined in Servant.API.Empty

Methods

showsPrec :: Int -> EmptyAPI -> ShowS

show :: EmptyAPI -> String

showList :: [EmptyAPI] -> ShowS

Eq EmptyAPI 
Instance details

Defined in Servant.API.Empty

Methods

(==) :: EmptyAPI -> EmptyAPI -> Bool

(/=) :: EmptyAPI -> EmptyAPI -> Bool

HasLink EmptyAPI 
Instance details

Defined in Servant.Links

Associated Types

type MkLink EmptyAPI a 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a) -> Proxy EmptyAPI -> Link -> MkLink EmptyAPI a #

HasServer EmptyAPI context Source #

The server for an EmptyAPI is emptyServer.

type MyApi = "nothing" :> EmptyApi

server :: Server MyApi
server = emptyServer
Instance details

Defined in Servant.Server.Internal

Associated Types

type ServerT EmptyAPI m 
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy EmptyAPI -> Context context -> Delayed env (Server EmptyAPI) -> Router env Source #

hoistServerWithContext :: Proxy EmptyAPI -> Proxy context -> (forall x. m x -> n x) -> ServerT EmptyAPI m -> ServerT EmptyAPI n Source #

HasServer api context => HasServer (EmptyAPI :> api :: Type) context Source #

Ignore EmptyAPI as part of route in server handlers.

Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (EmptyAPI :> api) -> Context context -> Delayed env (Server (EmptyAPI :> api)) -> Router env Source #

hoistServerWithContext :: Proxy (EmptyAPI :> api) -> Proxy context -> (forall x. m x -> n x) -> ServerT (EmptyAPI :> api) m -> ServerT (EmptyAPI :> api) n Source #

type MkLink EmptyAPI a 
Instance details

Defined in Servant.Links

type ServerT EmptyAPI m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (EmptyAPI :> api :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (EmptyAPI :> api :: Type) m = ServerT api m

data Fragment a #

Instances

Instances details
(HasLink sub, ToHttpApiData v) => HasLink (Fragment v :> sub :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a) -> Proxy (Fragment v :> sub) -> Link -> MkLink (Fragment v :> sub) a #

(AtMostOneFragment api, FragmentUnique (Fragment a1 :> api), HasServer api context) => HasServer (Fragment a1 :> api :: Type) context Source #

Ignore Fragment in server handlers. See https://ietf.org/rfc/rfc2616.html#section-15.1.3 for more details.

Example:

type MyApi = "books" :> Fragment Text :> Get '[JSON] [Book]

server :: Server MyApi
server = getBooks
  where getBooks :: Handler [Book]
        getBooks = ...return all books...
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (Fragment a1 :> api) -> Context context -> Delayed env (Server (Fragment a1 :> api)) -> Router env Source #

hoistServerWithContext :: Proxy (Fragment a1 :> api) -> Proxy context -> (forall x. m x -> n x) -> ServerT (Fragment a1 :> api) m -> ServerT (Fragment a1 :> api) n Source #

AtMostOneFragment (Fragment a) 
Instance details

Defined in Servant.API.TypeLevel

type MkLink (Fragment v :> sub :: Type) a 
Instance details

Defined in Servant.Links

type MkLink (Fragment v :> sub :: Type) a = v -> MkLink sub a
type ServerT (Fragment a1 :> api :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (Fragment a1 :> api :: Type) m = ServerT api m

class FramingRender (strategy :: k) where #

Methods

framingRender :: forall (m :: Type -> Type) a. Monad m => Proxy strategy -> (a -> ByteString) -> SourceT m a -> SourceT m ByteString #

Instances

Instances details
FramingRender NetstringFraming 
Instance details

Defined in Servant.API.Stream

Methods

framingRender :: forall (m :: Type -> Type) a. Monad m => Proxy NetstringFraming -> (a -> ByteString) -> SourceT m a -> SourceT m ByteString #

FramingRender NewlineFraming 
Instance details

Defined in Servant.API.Stream

Methods

framingRender :: forall (m :: Type -> Type) a. Monad m => Proxy NewlineFraming -> (a -> ByteString) -> SourceT m a -> SourceT m ByteString #

FramingRender NoFraming 
Instance details

Defined in Servant.API.Stream

Methods

framingRender :: forall (m :: Type -> Type) a. Monad m => Proxy NoFraming -> (a -> ByteString) -> SourceT m a -> SourceT m ByteString #

class FramingUnrender (strategy :: k) where #

Methods

framingUnrender :: forall (m :: Type -> Type) a. Monad m => Proxy strategy -> (ByteString -> Either String a) -> SourceT m ByteString -> SourceT m a #

Instances

Instances details
FramingUnrender NetstringFraming 
Instance details

Defined in Servant.API.Stream

Methods

framingUnrender :: forall (m :: Type -> Type) a. Monad m => Proxy NetstringFraming -> (ByteString -> Either String a) -> SourceT m ByteString -> SourceT m a #

FramingUnrender NewlineFraming 
Instance details

Defined in Servant.API.Stream

Methods

framingUnrender :: forall (m :: Type -> Type) a. Monad m => Proxy NewlineFraming -> (ByteString -> Either String a) -> SourceT m ByteString -> SourceT m a #

FramingUnrender NoFraming 
Instance details

Defined in Servant.API.Stream

Methods

framingUnrender :: forall (m :: Type -> Type) a. Monad m => Proxy NoFraming -> (ByteString -> Either String a) -> SourceT m ByteString -> SourceT m a #

class FromSourceIO chunk a | a -> chunk where #

Methods

fromSourceIO :: SourceIO chunk -> IO a #

Instances

Instances details
MonadIO m => FromSourceIO a (SourceT m a) 
Instance details

Defined in Servant.API.Stream

Methods

fromSourceIO :: SourceIO a -> IO (SourceT m a) #

data Header' (mods :: [Type]) (sym :: Symbol) a #

Instances

Instances details
(KnownSymbol h, ToHttpApiData v) => AddHeader mods h v (Headers (fst ': rest) a) (Headers (Header' mods h v ': (fst ': rest)) a) 
Instance details

Defined in Servant.API.ResponseHeaders

Methods

addOptionalHeader :: ResponseHeader h v -> Headers (fst ': rest) a -> Headers (Header' mods h v ': (fst ': rest)) a

HasResponseHeader h a (Header' mods h a ': rest) 
Instance details

Defined in Servant.API.ResponseHeaders

Methods

hlistLookupHeader :: HList (Header' mods h a ': rest) -> ResponseHeader h a

HasLink sub => HasLink (Header' mods sym a :> sub :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a0) -> Proxy (Header' mods sym a :> sub) -> Link -> MkLink (Header' mods sym a :> sub) a0 #

(KnownSymbol sym, FromHttpApiData a, HasServer api context, SBoolI (FoldRequired mods), SBoolI (FoldLenient mods), HasContextEntry (MkContextWithErrorFormatter context) ErrorFormatters) => HasServer (Header' mods sym a :> api :: Type) context Source #

If you use Header in one of the endpoints for your API, this automatically requires your server-side handler to be a function that takes an argument of the type specified by Header. This lets servant worry about extracting it from the request and turning it into a value of the type you specify.

All it asks is for a FromHttpApiData instance.

Example:

newtype Referer = Referer Text
  deriving (Eq, Show, FromHttpApiData)

           -- GET /view-my-referer
type MyApi = "view-my-referer" :> Header "Referer" Referer :> Get '[JSON] Referer

server :: Server MyApi
server = viewReferer
  where viewReferer :: Referer -> Handler referer
        viewReferer referer = return referer
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (Header' mods sym a :> api) -> Context context -> Delayed env (Server (Header' mods sym a :> api)) -> Router env Source #

hoistServerWithContext :: Proxy (Header' mods sym a :> api) -> Proxy context -> (forall x. m x -> n x) -> ServerT (Header' mods sym a :> api) m -> ServerT (Header' mods sym a :> api) n Source #

(FromHttpApiData v, BuildHeadersTo xs, KnownSymbol h) => BuildHeadersTo (Header' mods h v ': xs) 
Instance details

Defined in Servant.API.ResponseHeaders

Methods

buildHeadersTo :: [Header] -> HList (Header' mods h v ': xs) #

(KnownSymbol h, GetHeadersFromHList rest, ToHttpApiData v) => GetHeaders' (Header' mods h v ': rest) 
Instance details

Defined in Servant.API.ResponseHeaders

Methods

getHeaders' :: Headers (Header' mods h v ': rest) a -> [Header]

(KnownSymbol h, ToHttpApiData x, GetHeadersFromHList xs) => GetHeadersFromHList (Header' mods h x ': xs) 
Instance details

Defined in Servant.API.ResponseHeaders

Methods

getHeadersFromHList :: HList (Header' mods h x ': xs) -> [Header]

type MkLink (Header' mods sym a :> sub :: Type) r 
Instance details

Defined in Servant.Links

type MkLink (Header' mods sym a :> sub :: Type) r = MkLink sub r
type ServerT (Header' mods sym a :> api :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (Header' mods sym a :> api :: Type) m = RequestArgument mods a -> ServerT api m

type family If (cond :: Bool) (tru :: k) (fls :: k) :: k where ... #

Equations

If 'True (tru :: k) (fls :: k) = tru 
If 'False (tru :: k) (fls :: k) = fls 

data IsSecure #

Constructors

Secure 
NotSecure 

Instances

Instances details
Generic IsSecure 
Instance details

Defined in Servant.API.IsSecure

Associated Types

type Rep IsSecure 
Instance details

Defined in Servant.API.IsSecure

type Rep IsSecure = D1 ('MetaData "IsSecure" "Servant.API.IsSecure" "servant-0.20.2-Dpi2iKtDCNG45viqOW9pMM" 'False) (C1 ('MetaCons "Secure" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "NotSecure" 'PrefixI 'False) (U1 :: Type -> Type))

Methods

from :: IsSecure -> Rep IsSecure x

to :: Rep IsSecure x -> IsSecure

Read IsSecure 
Instance details

Defined in Servant.API.IsSecure

Methods

readsPrec :: Int -> ReadS IsSecure

readList :: ReadS [IsSecure]

readPrec :: ReadPrec IsSecure

readListPrec :: ReadPrec [IsSecure]

Show IsSecure 
Instance details

Defined in Servant.API.IsSecure

Methods

showsPrec :: Int -> IsSecure -> ShowS

show :: IsSecure -> String

showList :: [IsSecure] -> ShowS

Eq IsSecure 
Instance details

Defined in Servant.API.IsSecure

Methods

(==) :: IsSecure -> IsSecure -> Bool

(/=) :: IsSecure -> IsSecure -> Bool

Ord IsSecure 
Instance details

Defined in Servant.API.IsSecure

Methods

compare :: IsSecure -> IsSecure -> Ordering

(<) :: IsSecure -> IsSecure -> Bool

(<=) :: IsSecure -> IsSecure -> Bool

(>) :: IsSecure -> IsSecure -> Bool

(>=) :: IsSecure -> IsSecure -> Bool

max :: IsSecure -> IsSecure -> IsSecure

min :: IsSecure -> IsSecure -> IsSecure

HasLink sub => HasLink (IsSecure :> sub :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a) -> Proxy (IsSecure :> sub) -> Link -> MkLink (IsSecure :> sub) a #

HasServer api context => HasServer (IsSecure :> api :: Type) context Source # 
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (IsSecure :> api) -> Context context -> Delayed env (Server (IsSecure :> api)) -> Router env Source #

hoistServerWithContext :: Proxy (IsSecure :> api) -> Proxy context -> (forall x. m x -> n x) -> ServerT (IsSecure :> api) m -> ServerT (IsSecure :> api) n Source #

type Rep IsSecure 
Instance details

Defined in Servant.API.IsSecure

type Rep IsSecure = D1 ('MetaData "IsSecure" "Servant.API.IsSecure" "servant-0.20.2-Dpi2iKtDCNG45viqOW9pMM" 'False) (C1 ('MetaCons "Secure" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "NotSecure" 'PrefixI 'False) (U1 :: Type -> Type))
type MkLink (IsSecure :> sub :: Type) a 
Instance details

Defined in Servant.Links

type MkLink (IsSecure :> sub :: Type) a = MkLink sub a
type ServerT (IsSecure :> api :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (IsSecure :> api :: Type) m = IsSecure -> ServerT api m

data NoContentVerb (method :: k1) #

Instances

Instances details
HasLink (NoContentVerb m :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a) -> Proxy (NoContentVerb m) -> Link -> MkLink (NoContentVerb m) a #

ReflectMethod method => HasServer (NoContentVerb method :: Type) context Source # 
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (NoContentVerb method) -> Context context -> Delayed env (Server (NoContentVerb method)) -> Router env Source #

hoistServerWithContext :: Proxy (NoContentVerb method) -> Proxy context -> (forall x. m x -> n x) -> ServerT (NoContentVerb method) m -> ServerT (NoContentVerb method) n Source #

Generic (NoContentVerb method) 
Instance details

Defined in Servant.API.Verbs

Associated Types

type Rep (NoContentVerb method) 
Instance details

Defined in Servant.API.Verbs

type Rep (NoContentVerb method) = D1 ('MetaData "NoContentVerb" "Servant.API.Verbs" "servant-0.20.2-Dpi2iKtDCNG45viqOW9pMM" 'False) (V1 :: Type -> Type)

Methods

from :: NoContentVerb method -> Rep (NoContentVerb method) x

to :: Rep (NoContentVerb method) x -> NoContentVerb method

type MkLink (NoContentVerb m :: Type) r 
Instance details

Defined in Servant.Links

type MkLink (NoContentVerb m :: Type) r = r
type ServerT (NoContentVerb method :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (NoContentVerb method :: Type) m = m NoContent
type Rep (NoContentVerb method) 
Instance details

Defined in Servant.API.Verbs

type Rep (NoContentVerb method) = D1 ('MetaData "NoContentVerb" "Servant.API.Verbs" "servant-0.20.2-Dpi2iKtDCNG45viqOW9pMM" 'False) (V1 :: Type -> Type)

data QueryFlag (sym :: Symbol) #

Instances

Instances details
(KnownSymbol sym, HasLink sub) => HasLink (QueryFlag sym :> sub :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a) -> Proxy (QueryFlag sym :> sub) -> Link -> MkLink (QueryFlag sym :> sub) a #

(KnownSymbol sym, HasServer api context) => HasServer (QueryFlag sym :> api :: Type) context Source #

If you use QueryFlag "published" in one of the endpoints for your API, this automatically requires your server-side handler to be a function that takes an argument of type Bool.

Example:

type MyApi = "books" :> QueryFlag "published" :> Get '[JSON] [Book]

server :: Server MyApi
server = getBooks
  where getBooks :: Bool -> Handler [Book]
        getBooks onlyPublished = ...return all books, or only the ones that are already published, depending on the argument...
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (QueryFlag sym :> api) -> Context context -> Delayed env (Server (QueryFlag sym :> api)) -> Router env Source #

hoistServerWithContext :: Proxy (QueryFlag sym :> api) -> Proxy context -> (forall x. m x -> n x) -> ServerT (QueryFlag sym :> api) m -> ServerT (QueryFlag sym :> api) n Source #

type MkLink (QueryFlag sym :> sub :: Type) a 
Instance details

Defined in Servant.Links

type MkLink (QueryFlag sym :> sub :: Type) a = Bool -> MkLink sub a
type ServerT (QueryFlag sym :> api :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (QueryFlag sym :> api :: Type) m = Bool -> ServerT api m

data QueryParam' (mods :: [Type]) (sym :: Symbol) a #

Instances

Instances details
(KnownSymbol sym, ToHttpApiData v, HasLink sub, SBoolI (FoldRequired mods)) => HasLink (QueryParam' mods sym v :> sub :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a) -> Proxy (QueryParam' mods sym v :> sub) -> Link -> MkLink (QueryParam' mods sym v :> sub) a #

(KnownSymbol sym, FromHttpApiData a, HasServer api context, SBoolI (FoldRequired mods), SBoolI (FoldLenient mods), HasContextEntry (MkContextWithErrorFormatter context) ErrorFormatters) => HasServer (QueryParam' mods sym a :> api :: Type) context Source #

If you use QueryParam "author" Text in one of the endpoints for your API, this automatically requires your server-side handler to be a function that takes an argument of type Maybe Text.

This lets servant worry about looking it up in the query string and turning it into a value of the type you specify, enclosed in Maybe, because it may not be there and servant would then hand you Nothing.

You can control how it'll be converted from Text to your type by simply providing an instance of FromHttpApiData for your type.

Example:

type MyApi = "books" :> QueryParam "author" Text :> Get '[JSON] [Book]

server :: Server MyApi
server = getBooksBy
  where getBooksBy :: Maybe Text -> Handler [Book]
        getBooksBy Nothing       = ...return all books...
        getBooksBy (Just author) = ...return books by the given author...
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (QueryParam' mods sym a :> api) -> Context context -> Delayed env (Server (QueryParam' mods sym a :> api)) -> Router env Source #

hoistServerWithContext :: Proxy (QueryParam' mods sym a :> api) -> Proxy context -> (forall x. m x -> n x) -> ServerT (QueryParam' mods sym a :> api) m -> ServerT (QueryParam' mods sym a :> api) n Source #

type MkLink (QueryParam' mods sym v :> sub :: Type) a 
Instance details

Defined in Servant.Links

type MkLink (QueryParam' mods sym v :> sub :: Type) a = If (FoldRequired mods) v (Maybe v) -> MkLink sub a
type ServerT (QueryParam' mods sym a :> api :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (QueryParam' mods sym a :> api :: Type) m = RequestArgument mods a -> ServerT api m

data QueryParams (sym :: Symbol) a #

Instances

Instances details
(KnownSymbol sym, ToHttpApiData v, HasLink sub) => HasLink (QueryParams sym v :> sub :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a) -> Proxy (QueryParams sym v :> sub) -> Link -> MkLink (QueryParams sym v :> sub) a #

(KnownSymbol sym, FromHttpApiData a, HasServer api context, HasContextEntry (MkContextWithErrorFormatter context) ErrorFormatters) => HasServer (QueryParams sym a :> api :: Type) context Source #

If you use QueryParams "authors" Text in one of the endpoints for your API, this automatically requires your server-side handler to be a function that takes an argument of type [Text].

This lets servant worry about looking up 0 or more values in the query string associated to authors and turning each of them into a value of the type you specify.

You can control how the individual values are converted from Text to your type by simply providing an instance of FromHttpApiData for your type.

Example:

type MyApi = "books" :> QueryParams "authors" Text :> Get '[JSON] [Book]

server :: Server MyApi
server = getBooksBy
  where getBooksBy :: [Text] -> Handler [Book]
        getBooksBy authors = ...return all books by these authors...
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (QueryParams sym a :> api) -> Context context -> Delayed env (Server (QueryParams sym a :> api)) -> Router env Source #

hoistServerWithContext :: Proxy (QueryParams sym a :> api) -> Proxy context -> (forall x. m x -> n x) -> ServerT (QueryParams sym a :> api) m -> ServerT (QueryParams sym a :> api) n Source #

type MkLink (QueryParams sym v :> sub :: Type) a 
Instance details

Defined in Servant.Links

type MkLink (QueryParams sym v :> sub :: Type) a = [v] -> MkLink sub a
type ServerT (QueryParams sym a :> api :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (QueryParams sym a :> api :: Type) m = [a] -> ServerT api m

data QueryString #

Instances

Instances details
HasServer api context => HasServer (QueryString :> api :: Type) context Source #

If you use QueryString in one of the endpoints for your API, this automatically requires your server-side handler to be a function that takes an argument of type Query ([(ByteString, Maybe ByteString)]).

This lets you extract the whole query string. This is useful when the query string can contain parameters with dynamic names, that you can't access with QueryParam.

Example:

type MyApi = "books" :> QueryString :> Get '[JSON] [Book]

server :: Server MyApi
server = getBooksBy
  where getBooksBy :: Query -> Handler [Book]
        getBooksBy filters = ...filter books based on the dynamic filters provided...
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (QueryString :> api) -> Context context -> Delayed env (Server (QueryString :> api)) -> Router env Source #

hoistServerWithContext :: Proxy (QueryString :> api) -> Proxy context -> (forall x. m x -> n x) -> ServerT (QueryString :> api) m -> ServerT (QueryString :> api) n Source #

type ServerT (QueryString :> api :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (QueryString :> api :: Type) m = Query -> ServerT api m

data Raw #

Instances

Instances details
HasLink Raw 
Instance details

Defined in Servant.Links

Associated Types

type MkLink Raw a 
Instance details

Defined in Servant.Links

type MkLink Raw a = a

Methods

toLink :: (Link -> a) -> Proxy Raw -> Link -> MkLink Raw a #

HasServer Raw context Source #

Just pass the request to the underlying application and serve its response.

Example:

type MyApi = "images" :> Raw

server :: Server MyApi
server = serveDirectory "/var/www/images"
Instance details

Defined in Servant.Server.Internal

Associated Types

type ServerT Raw m 
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy Raw -> Context context -> Delayed env (Server Raw) -> Router env Source #

hoistServerWithContext :: Proxy Raw -> Proxy context -> (forall x. m x -> n x) -> ServerT Raw m -> ServerT Raw n Source #

type MkLink Raw a 
Instance details

Defined in Servant.Links

type MkLink Raw a = a
type ServerT Raw m Source # 
Instance details

Defined in Servant.Server.Internal

data RawM #

Instances

Instances details
HasLink RawM 
Instance details

Defined in Servant.Links

Associated Types

type MkLink RawM a 
Instance details

Defined in Servant.Links

type MkLink RawM a = a

Methods

toLink :: (Link -> a) -> Proxy RawM -> Link -> MkLink RawM a #

HasServer RawM context Source #

Just pass the request to the underlying application and serve its response.

Example:

type MyApi = "images" :> Raw

server :: Server MyApi
server = serveDirectory "/var/www/images"
Instance details

Defined in Servant.Server.Internal

Associated Types

type ServerT RawM m 
Instance details

Defined in Servant.Server.Internal

type ServerT RawM m = Request -> (Response -> IO ResponseReceived) -> m ResponseReceived

Methods

route :: Proxy RawM -> Context context -> Delayed env (Server RawM) -> Router env Source #

hoistServerWithContext :: Proxy RawM -> Proxy context -> (forall x. m x -> n x) -> ServerT RawM m -> ServerT RawM n Source #

type MkLink RawM a 
Instance details

Defined in Servant.Links

type MkLink RawM a = a
type ServerT RawM m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT RawM m = Request -> (Response -> IO ResponseReceived) -> m ResponseReceived

class ReflectMethod (a :: k) where #

Methods

reflectMethod :: Proxy a -> Method #

Instances

Instances details
ReflectMethod 'CONNECT 
Instance details

Defined in Servant.API.Verbs

Methods

reflectMethod :: Proxy 'CONNECT -> Method #

ReflectMethod 'DELETE 
Instance details

Defined in Servant.API.Verbs

Methods

reflectMethod :: Proxy 'DELETE -> Method #

ReflectMethod 'GET 
Instance details

Defined in Servant.API.Verbs

Methods

reflectMethod :: Proxy 'GET -> Method #

ReflectMethod 'HEAD 
Instance details

Defined in Servant.API.Verbs

Methods

reflectMethod :: Proxy 'HEAD -> Method #

ReflectMethod 'OPTIONS 
Instance details

Defined in Servant.API.Verbs

Methods

reflectMethod :: Proxy 'OPTIONS -> Method #

ReflectMethod 'PATCH 
Instance details

Defined in Servant.API.Verbs

Methods

reflectMethod :: Proxy 'PATCH -> Method #

ReflectMethod 'POST 
Instance details

Defined in Servant.API.Verbs

Methods

reflectMethod :: Proxy 'POST -> Method #

ReflectMethod 'PUT 
Instance details

Defined in Servant.API.Verbs

Methods

reflectMethod :: Proxy 'PUT -> Method #

ReflectMethod 'TRACE 
Instance details

Defined in Servant.API.Verbs

Methods

reflectMethod :: Proxy 'TRACE -> Method #

data RemoteHost #

Instances

Instances details
HasLink sub => HasLink (RemoteHost :> sub :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a) -> Proxy (RemoteHost :> sub) -> Link -> MkLink (RemoteHost :> sub) a #

HasServer api context => HasServer (RemoteHost :> api :: Type) context Source # 
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (RemoteHost :> api) -> Context context -> Delayed env (Server (RemoteHost :> api)) -> Router env Source #

hoistServerWithContext :: Proxy (RemoteHost :> api) -> Proxy context -> (forall x. m x -> n x) -> ServerT (RemoteHost :> api) m -> ServerT (RemoteHost :> api) n Source #

type MkLink (RemoteHost :> sub :: Type) a 
Instance details

Defined in Servant.Links

type MkLink (RemoteHost :> sub :: Type) a = MkLink sub a
type ServerT (RemoteHost :> api :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (RemoteHost :> api :: Type) m = SockAddr -> ServerT api m

data ReqBody' (mods :: [Type]) (contentTypes :: [Type]) a #

Instances

Instances details
HasLink sub => HasLink (ReqBody' mods ct a :> sub :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a0) -> Proxy (ReqBody' mods ct a :> sub) -> Link -> MkLink (ReqBody' mods ct a :> sub) a0 #

(AllCTUnrender list a, HasServer api context, SBoolI (FoldLenient mods), HasContextEntry (MkContextWithErrorFormatter context) ErrorFormatters) => HasServer (ReqBody' mods list a :> api :: Type) context Source #

If you use ReqBody in one of the endpoints for your API, this automatically requires your server-side handler to be a function that takes an argument of the type specified by ReqBody. The Content-Type header is inspected, and the list provided is used to attempt deserialization. If the request does not have a Content-Type header, it is treated as application/octet-stream (as specified in RFC 7231 section 3.1.1.5). This lets servant worry about extracting it from the request and turning it into a value of the type you specify.

All it asks is for a FromJSON instance.

Example:

type MyApi = "books" :> ReqBody '[JSON] Book :> Post '[JSON] Book

server :: Server MyApi
server = postBook
  where postBook :: Book -> Handler Book
        postBook book = ...insert into your db...
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (ReqBody' mods list a :> api) -> Context context -> Delayed env (Server (ReqBody' mods list a :> api)) -> Router env Source #

hoistServerWithContext :: Proxy (ReqBody' mods list a :> api) -> Proxy context -> (forall x. m x -> n x) -> ServerT (ReqBody' mods list a :> api) m -> ServerT (ReqBody' mods list a :> api) n Source #

type MkLink (ReqBody' mods ct a :> sub :: Type) r 
Instance details

Defined in Servant.Links

type MkLink (ReqBody' mods ct a :> sub :: Type) r = MkLink sub r
type ServerT (ReqBody' mods list a :> api :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (ReqBody' mods list a :> api :: Type) m = If (FoldLenient mods) (Either String a) a -> ServerT api m

data SBool (b :: Bool) where #

Constructors

STrue :: SBool 'True 
SFalse :: SBool 'False 

Instances

Instances details
EqP SBool 
Instance details

Defined in Data.Singletons.Bool

Methods

eqp :: forall (a :: Bool) (b :: Bool). SBool a -> SBool b -> Bool

GNFData SBool 
Instance details

Defined in Data.Singletons.Bool

Methods

grnf :: forall (a :: Bool). SBool a -> ()

GCompare SBool 
Instance details

Defined in Data.Singletons.Bool

Methods

gcompare :: forall (a :: Bool) (b :: Bool). SBool a -> SBool b -> GOrdering a b

GEq SBool 
Instance details

Defined in Data.Singletons.Bool

Methods

geq :: forall (a :: Bool) (b :: Bool). SBool a -> SBool b -> Maybe (a :~: b)

GRead SBool 
Instance details

Defined in Data.Singletons.Bool

Methods

greadsPrec :: Int -> GReadS SBool

GShow SBool 
Instance details

Defined in Data.Singletons.Bool

Methods

gshowsPrec :: forall (a :: Bool). Int -> SBool a -> ShowS

OrdP SBool 
Instance details

Defined in Data.Singletons.Bool

Methods

comparep :: forall (a :: Bool) (b :: Bool). SBool a -> SBool b -> Ordering

SBoolI b => Boring (SBool b) 
Instance details

Defined in Data.Singletons.Bool

Methods

boring :: SBool b

NFData (SBool b) 
Instance details

Defined in Data.Singletons.Bool

Methods

rnf :: SBool b -> ()

Show (SBool b) 
Instance details

Defined in Data.Singletons.Bool

Methods

showsPrec :: Int -> SBool b -> ShowS

show :: SBool b -> String

showList :: [SBool b] -> ShowS

Eq (SBool b) 
Instance details

Defined in Data.Singletons.Bool

Methods

(==) :: SBool b -> SBool b -> Bool

(/=) :: SBool b -> SBool b -> Bool

Ord (SBool b) 
Instance details

Defined in Data.Singletons.Bool

Methods

compare :: SBool b -> SBool b -> Ordering

(<) :: SBool b -> SBool b -> Bool

(<=) :: SBool b -> SBool b -> Bool

(>) :: SBool b -> SBool b -> Bool

(>=) :: SBool b -> SBool b -> Bool

max :: SBool b -> SBool b -> SBool b

min :: SBool b -> SBool b -> SBool b

class SBoolI (b :: Bool) where #

Methods

sbool :: SBool b #

Instances

Instances details
SBoolI 'False 
Instance details

Defined in Data.Singletons.Bool

Methods

sbool :: SBool 'False #

SBoolI 'True 
Instance details

Defined in Data.Singletons.Bool

Methods

sbool :: SBool 'True #

type SourceIO = SourceT IO #

data Stream (method :: k1) (status :: Nat) framing contentType a #

Instances

Instances details
HasLink (Stream m status fr ct a :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a0) -> Proxy (Stream m status fr ct a) -> Link -> MkLink (Stream m status fr ct a) a0 #

(MimeRender ctype chunk, ReflectMethod method, KnownNat status, FramingRender framing, ToSourceIO chunk a, GetHeaders (Headers h a)) => HasServer (Stream method status framing ctype (Headers h a) :: Type) context Source # 
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (Stream method status framing ctype (Headers h a)) -> Context context -> Delayed env (Server (Stream method status framing ctype (Headers h a))) -> Router env Source #

hoistServerWithContext :: Proxy (Stream method status framing ctype (Headers h a)) -> Proxy context -> (forall x. m x -> n x) -> ServerT (Stream method status framing ctype (Headers h a)) m -> ServerT (Stream method status framing ctype (Headers h a)) n Source #

(MimeRender ctype chunk, ReflectMethod method, KnownNat status, FramingRender framing, ToSourceIO chunk a) => HasServer (Stream method status framing ctype a :: Type) context Source # 
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (Stream method status framing ctype a) -> Context context -> Delayed env (Server (Stream method status framing ctype a)) -> Router env Source #

hoistServerWithContext :: Proxy (Stream method status framing ctype a) -> Proxy context -> (forall x. m x -> n x) -> ServerT (Stream method status framing ctype a) m -> ServerT (Stream method status framing ctype a) n Source #

Generic (Stream method status framing contentType a) 
Instance details

Defined in Servant.API.Stream

Associated Types

type Rep (Stream method status framing contentType a) 
Instance details

Defined in Servant.API.Stream

type Rep (Stream method status framing contentType a) = D1 ('MetaData "Stream" "Servant.API.Stream" "servant-0.20.2-Dpi2iKtDCNG45viqOW9pMM" 'False) (V1 :: Type -> Type)

Methods

from :: Stream method status framing contentType a -> Rep (Stream method status framing contentType a) x

to :: Rep (Stream method status framing contentType a) x -> Stream method status framing contentType a

type MkLink (Stream m status fr ct a :: Type) r 
Instance details

Defined in Servant.Links

type MkLink (Stream m status fr ct a :: Type) r = r
type ServerT (Stream method status framing ctype (Headers h a) :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (Stream method status framing ctype (Headers h a) :: Type) m = m (Headers h a)
type ServerT (Stream method status framing ctype a :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (Stream method status framing ctype a :: Type) m = m a
type Rep (Stream method status framing contentType a) 
Instance details

Defined in Servant.API.Stream

type Rep (Stream method status framing contentType a) = D1 ('MetaData "Stream" "Servant.API.Stream" "servant-0.20.2-Dpi2iKtDCNG45viqOW9pMM" 'False) (V1 :: Type -> Type)

data StreamBody' (mods :: [Type]) framing contentType a #

Instances

Instances details
HasLink sub => HasLink (StreamBody' mods framing ct a :> sub :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a0) -> Proxy (StreamBody' mods framing ct a :> sub) -> Link -> MkLink (StreamBody' mods framing ct a :> sub) a0 #

(FramingUnrender framing, FromSourceIO chunk a, MimeUnrender ctype chunk, HasServer api context) => HasServer (StreamBody' mods framing ctype a :> api :: Type) context Source # 
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (StreamBody' mods framing ctype a :> api) -> Context context -> Delayed env (Server (StreamBody' mods framing ctype a :> api)) -> Router env Source #

hoistServerWithContext :: Proxy (StreamBody' mods framing ctype a :> api) -> Proxy context -> (forall x. m x -> n x) -> ServerT (StreamBody' mods framing ctype a :> api) m -> ServerT (StreamBody' mods framing ctype a :> api) n Source #

Generic (StreamBody' mods framing contentType a) 
Instance details

Defined in Servant.API.Stream

Associated Types

type Rep (StreamBody' mods framing contentType a) 
Instance details

Defined in Servant.API.Stream

type Rep (StreamBody' mods framing contentType a) = D1 ('MetaData "StreamBody'" "Servant.API.Stream" "servant-0.20.2-Dpi2iKtDCNG45viqOW9pMM" 'False) (V1 :: Type -> Type)

Methods

from :: StreamBody' mods framing contentType a -> Rep (StreamBody' mods framing contentType a) x

to :: Rep (StreamBody' mods framing contentType a) x -> StreamBody' mods framing contentType a

type MkLink (StreamBody' mods framing ct a :> sub :: Type) r 
Instance details

Defined in Servant.Links

type MkLink (StreamBody' mods framing ct a :> sub :: Type) r = MkLink sub r
type ServerT (StreamBody' mods framing ctype a :> api :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (StreamBody' mods framing ctype a :> api :: Type) m = a -> ServerT api m
type Rep (StreamBody' mods framing contentType a) 
Instance details

Defined in Servant.API.Stream

type Rep (StreamBody' mods framing contentType a) = D1 ('MetaData "StreamBody'" "Servant.API.Stream" "servant-0.20.2-Dpi2iKtDCNG45viqOW9pMM" 'False) (V1 :: Type -> Type)

data Summary (sym :: Symbol) #

Instances

Instances details
HasLink sub => HasLink (Summary s :> sub :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a) -> Proxy (Summary s :> sub) -> Link -> MkLink (Summary s :> sub) a #

HasServer api ctx => HasServer (Summary desc :> api :: Type) ctx Source #

Ignore Summary in server handlers.

Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (Summary desc :> api) -> Context ctx -> Delayed env (Server (Summary desc :> api)) -> Router env Source #

hoistServerWithContext :: Proxy (Summary desc :> api) -> Proxy ctx -> (forall x. m x -> n x) -> ServerT (Summary desc :> api) m -> ServerT (Summary desc :> api) n Source #

type MkLink (Summary s :> sub :: Type) a 
Instance details

Defined in Servant.Links

type MkLink (Summary s :> sub :: Type) a = MkLink sub a
type ServerT (Summary desc :> api :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (Summary desc :> api :: Type) m = ServerT api m

class ToSourceIO chunk a | a -> chunk where #

Methods

toSourceIO :: a -> SourceIO chunk #

Instances

Instances details
ToSourceIO a (NonEmpty a) 
Instance details

Defined in Servant.API.Stream

Methods

toSourceIO :: NonEmpty a -> SourceIO a #

ToSourceIO a [a] 
Instance details

Defined in Servant.API.Stream

Methods

toSourceIO :: [a] -> SourceIO a #

SourceToSourceIO m => ToSourceIO chunk (SourceT m chunk) 
Instance details

Defined in Servant.API.Stream

Methods

toSourceIO :: SourceT m chunk -> SourceIO chunk #

type Vault = Vault RealWorld #

data Verb (method :: k1) (statusCode :: Nat) (contentTypes :: [Type]) a #

Instances

Instances details
HasLink (Verb m s ct a :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a0) -> Proxy (Verb m s ct a) -> Link -> MkLink (Verb m s ct a) a0 #

(AllCTRender ctypes a, ReflectMethod method, KnownNat status, GetHeaders (Headers h a)) => HasServer (Verb method status ctypes (Headers h a) :: Type) context Source # 
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (Verb method status ctypes (Headers h a)) -> Context context -> Delayed env (Server (Verb method status ctypes (Headers h a))) -> Router env Source #

hoistServerWithContext :: Proxy (Verb method status ctypes (Headers h a)) -> Proxy context -> (forall x. m x -> n x) -> ServerT (Verb method status ctypes (Headers h a)) m -> ServerT (Verb method status ctypes (Headers h a)) n Source #

(AllCTRender ctypes a, ReflectMethod method, KnownNat status) => HasServer (Verb method status ctypes a :: Type) context Source # 
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (Verb method status ctypes a) -> Context context -> Delayed env (Server (Verb method status ctypes a)) -> Router env Source #

hoistServerWithContext :: Proxy (Verb method status ctypes a) -> Proxy context -> (forall x. m x -> n x) -> ServerT (Verb method status ctypes a) m -> ServerT (Verb method status ctypes a) n Source #

Generic (Verb method statusCode contentTypes a) 
Instance details

Defined in Servant.API.Verbs

Associated Types

type Rep (Verb method statusCode contentTypes a) 
Instance details

Defined in Servant.API.Verbs

type Rep (Verb method statusCode contentTypes a) = D1 ('MetaData "Verb" "Servant.API.Verbs" "servant-0.20.2-Dpi2iKtDCNG45viqOW9pMM" 'False) (V1 :: Type -> Type)

Methods

from :: Verb method statusCode contentTypes a -> Rep (Verb method statusCode contentTypes a) x

to :: Rep (Verb method statusCode contentTypes a) x -> Verb method statusCode contentTypes a

AtMostOneFragment (Verb m s ct typ) 
Instance details

Defined in Servant.API.TypeLevel

type MkLink (Verb m s ct a :: Type) r 
Instance details

Defined in Servant.Links

type MkLink (Verb m s ct a :: Type) r = r
type ServerT (Verb method status ctypes (Headers h a) :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (Verb method status ctypes (Headers h a) :: Type) m = m (Headers h a)
type ServerT (Verb method status ctypes a :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (Verb method status ctypes a :: Type) m = m a
type Rep (Verb method statusCode contentTypes a) 
Instance details

Defined in Servant.API.Verbs

type Rep (Verb method statusCode contentTypes a) = D1 ('MetaData "Verb" "Servant.API.Verbs" "servant-0.20.2-Dpi2iKtDCNG45viqOW9pMM" 'False) (V1 :: Type -> Type)

data WithNamedContext (name :: Symbol) (subContext :: [Type]) (subApi :: k) #

Instances

Instances details
HasLink sub => HasLink (WithNamedContext name context sub :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a) -> Proxy (WithNamedContext name context sub) -> Link -> MkLink (WithNamedContext name context sub) a #

(HasContextEntry context (NamedContext name subContext), HasServer subApi subContext) => HasServer (WithNamedContext name subContext subApi :: Type) context Source # 
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (WithNamedContext name subContext subApi) -> Context context -> Delayed env (Server (WithNamedContext name subContext subApi)) -> Router env Source #

hoistServerWithContext :: Proxy (WithNamedContext name subContext subApi) -> Proxy context -> (forall x. m x -> n x) -> ServerT (WithNamedContext name subContext subApi) m -> ServerT (WithNamedContext name subContext subApi) n Source #

type MkLink (WithNamedContext name context sub :: Type) a 
Instance details

Defined in Servant.Links

type MkLink (WithNamedContext name context sub :: Type) a = MkLink sub a
type ServerT (WithNamedContext name subContext subApi :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (WithNamedContext name subContext subApi :: Type) m = ServerT subApi m

data WithResource (res :: k) #

Instances

Instances details
HasLink sub => HasLink (WithResource res :> sub :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a) -> Proxy (WithResource res :> sub) -> Link -> MkLink (WithResource res :> sub) a #

(HasServer api ctx, HasContextEntry ctx (Acquire a)) => HasServer (WithResource a :> api :: Type) ctx Source #

If you use WithResource in one of the endpoints for your API Servant will provide the handler for this endpoint an argument of the specified type. The lifespan of this resource will be automatically managed by Servant. This resource will be created before the handler starts and it will be destoyed after it ends. A new resource is created for each request to the endpoint.

Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (WithResource a :> api) -> Context ctx -> Delayed env (Server (WithResource a :> api)) -> Router env Source #

hoistServerWithContext :: Proxy (WithResource a :> api) -> Proxy ctx -> (forall x. m x -> n x) -> ServerT (WithResource a :> api) m -> ServerT (WithResource a :> api) n Source #

type MkLink (WithResource res :> sub :: Type) a 
Instance details

Defined in Servant.Links

type MkLink (WithResource res :> sub :: Type) a = MkLink sub a
type ServerT (WithResource a :> api :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (WithResource a :> api :: Type) m = (ReleaseKey, a) -> ServerT api m

data NamedRoutes (api :: Type -> Type) #

Instances

Instances details
(HasLink (ToServantApi routes), forall a. GLink routes a, ErrorIfNoGeneric routes) => HasLink (NamedRoutes routes :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a) -> Proxy (NamedRoutes routes) -> Link -> MkLink (NamedRoutes routes) a #

(HasServer (ToServantApi api) context, forall (m :: Type -> Type). Generic (api (AsServerT m)), forall (m :: Type -> Type). GServer api m, ErrorIfNoGeneric api) => HasServer (NamedRoutes api :: Type) context Source # 
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (NamedRoutes api) -> Context context -> Delayed env (Server (NamedRoutes api)) -> Router env Source #

hoistServerWithContext :: Proxy (NamedRoutes api) -> Proxy context -> (forall x. m x -> n x) -> ServerT (NamedRoutes api) m -> ServerT (NamedRoutes api) n Source #

type MkLink (NamedRoutes routes :: Type) a 
Instance details

Defined in Servant.Links

type MkLink (NamedRoutes routes :: Type) a = routes (AsLink a)
type ServerT (NamedRoutes api :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (NamedRoutes api :: Type) m = api (AsServerT m)

class GenericMode (mode :: k) #

Associated Types

type (mode :: k) :- api #

Instances

Instances details
GenericMode AsApi 
Instance details

Defined in Servant.API.Generic

Associated Types

type AsApi :- api 
Instance details

Defined in Servant.API.Generic

type AsApi :- api = api
GenericMode (AsLink a :: Type) 
Instance details

Defined in Servant.Links

GenericMode (AsServerT m :: Type) Source # 
Instance details

Defined in Servant.Server.Internal

type ToServant (routes :: k -> Type) (mode :: k) = GToServant (Rep (routes mode)) #

type ToServantApi (routes :: Type -> Type) = ToServant routes AsApi #

class GServantProduct (f :: k -> Type) #

Minimal complete definition

gtoServant, gfromServant

Instances

Instances details
(GServantProduct l, GServantProduct r) => GServantProduct (l :*: r :: k -> Type) 
Instance details

Defined in Servant.API.Generic

Associated Types

type GToServant (l :*: r :: k -> Type) 
Instance details

Defined in Servant.API.Generic

type GToServant (l :*: r :: k -> Type) = GToServant l :<|> GToServant r

Methods

gtoServant :: forall (p :: k). (l :*: r) p -> GToServant (l :*: r)

gfromServant :: forall (p :: k). GToServant (l :*: r) -> (l :*: r) p

GServantProduct (K1 i c :: k -> Type) 
Instance details

Defined in Servant.API.Generic

Associated Types

type GToServant (K1 i c :: k -> Type) 
Instance details

Defined in Servant.API.Generic

type GToServant (K1 i c :: k -> Type) = c

Methods

gtoServant :: forall (p :: k). K1 i c p -> GToServant (K1 i c :: k -> Type)

gfromServant :: forall (p :: k). GToServant (K1 i c :: k -> Type) -> K1 i c p

GServantProduct f => GServantProduct (M1 i c f :: k -> Type) 
Instance details

Defined in Servant.API.Generic

Associated Types

type GToServant (M1 i c f :: k -> Type) 
Instance details

Defined in Servant.API.Generic

type GToServant (M1 i c f :: k -> Type) = GToServant f

Methods

gtoServant :: forall (p :: k). M1 i c f p -> GToServant (M1 i c f)

gfromServant :: forall (p :: k). GToServant (M1 i c f) -> M1 i c f p

toServant :: forall {k} routes (mode :: k). GenericServant routes mode => routes mode -> ToServant routes mode #

fromServant :: forall {k} routes (mode :: k). GenericServant routes mode => ToServant routes mode -> routes mode #

class Accept ctype => MimeRender (ctype :: k) a where #

Methods

mimeRender :: Proxy ctype -> a -> ByteString #

Instances

Instances details
ToForm a => MimeRender FormUrlEncoded a 
Instance details

Defined in Servant.API.ContentTypes

Methods

mimeRender :: Proxy FormUrlEncoded -> a -> ByteString #

ToJSON a => MimeRender JSON a 
Instance details

Defined in Servant.API.ContentTypes

Methods

mimeRender :: Proxy JSON -> a -> ByteString #

MimeRender OctetStream ByteString 
Instance details

Defined in Servant.API.ContentTypes

Methods

mimeRender :: Proxy OctetStream -> ByteString -> ByteString #

MimeRender OctetStream ByteString 
Instance details

Defined in Servant.API.ContentTypes

Methods

mimeRender :: Proxy OctetStream -> ByteString -> ByteString #

MimeRender PlainText Text 
Instance details

Defined in Servant.API.ContentTypes

Methods

mimeRender :: Proxy PlainText -> Text -> ByteString #

MimeRender PlainText Text 
Instance details

Defined in Servant.API.ContentTypes

Methods

mimeRender :: Proxy PlainText -> Text -> ByteString #

MimeRender PlainText String 
Instance details

Defined in Servant.API.ContentTypes

Methods

mimeRender :: Proxy PlainText -> String -> ByteString #

MimeRender FormUrlEncoded a => MimeRender FormUrlEncoded (WithStatus _status a) 
Instance details

Defined in Servant.API.UVerb

Methods

mimeRender :: Proxy FormUrlEncoded -> WithStatus _status a -> ByteString #

MimeRender JSON a => MimeRender JSON (WithStatus _status a) 
Instance details

Defined in Servant.API.UVerb

Methods

mimeRender :: Proxy JSON -> WithStatus _status a -> ByteString #

MimeRender OctetStream a => MimeRender OctetStream (WithStatus _status a) 
Instance details

Defined in Servant.API.UVerb

Methods

mimeRender :: Proxy OctetStream -> WithStatus _status a -> ByteString #

MimeRender PlainText a => MimeRender PlainText (WithStatus _status a) 
Instance details

Defined in Servant.API.UVerb

Methods

mimeRender :: Proxy PlainText -> WithStatus _status a -> ByteString #

class Accept ctype => MimeUnrender (ctype :: k) a where #

Minimal complete definition

mimeUnrender | mimeUnrenderWithType

Methods

mimeUnrender :: Proxy ctype -> ByteString -> Either String a #

mimeUnrenderWithType :: Proxy ctype -> MediaType -> ByteString -> Either String a #

Instances

Instances details
FromForm a => MimeUnrender FormUrlEncoded a 
Instance details

Defined in Servant.API.ContentTypes

Methods

mimeUnrender :: Proxy FormUrlEncoded -> ByteString -> Either String a #

mimeUnrenderWithType :: Proxy FormUrlEncoded -> MediaType -> ByteString -> Either String a #

FromJSON a => MimeUnrender JSON a 
Instance details

Defined in Servant.API.ContentTypes

Methods

mimeUnrender :: Proxy JSON -> ByteString -> Either String a #

mimeUnrenderWithType :: Proxy JSON -> MediaType -> ByteString -> Either String a #

MimeUnrender OctetStream ByteString 
Instance details

Defined in Servant.API.ContentTypes

Methods

mimeUnrender :: Proxy OctetStream -> ByteString -> Either String ByteString #

mimeUnrenderWithType :: Proxy OctetStream -> MediaType -> ByteString -> Either String ByteString #

MimeUnrender OctetStream ByteString 
Instance details

Defined in Servant.API.ContentTypes

Methods

mimeUnrender :: Proxy OctetStream -> ByteString -> Either String ByteString #

mimeUnrenderWithType :: Proxy OctetStream -> MediaType -> ByteString -> Either String ByteString #

MimeUnrender PlainText Text 
Instance details

Defined in Servant.API.ContentTypes

Methods

mimeUnrender :: Proxy PlainText -> ByteString -> Either String Text #

mimeUnrenderWithType :: Proxy PlainText -> MediaType -> ByteString -> Either String Text #

MimeUnrender PlainText Text 
Instance details

Defined in Servant.API.ContentTypes

Methods

mimeUnrender :: Proxy PlainText -> ByteString -> Either String Text #

mimeUnrenderWithType :: Proxy PlainText -> MediaType -> ByteString -> Either String Text #

MimeUnrender PlainText String 
Instance details

Defined in Servant.API.ContentTypes

Methods

mimeUnrender :: Proxy PlainText -> ByteString -> Either String String #

mimeUnrenderWithType :: Proxy PlainText -> MediaType -> ByteString -> Either String String #

MimeUnrender FormUrlEncoded a => MimeUnrender FormUrlEncoded (WithStatus _status a) 
Instance details

Defined in Servant.API.UVerb

Methods

mimeUnrender :: Proxy FormUrlEncoded -> ByteString -> Either String (WithStatus _status a) #

mimeUnrenderWithType :: Proxy FormUrlEncoded -> MediaType -> ByteString -> Either String (WithStatus _status a) #

MimeUnrender JSON a => MimeUnrender JSON (WithStatus _status a) 
Instance details

Defined in Servant.API.UVerb

Methods

mimeUnrender :: Proxy JSON -> ByteString -> Either String (WithStatus _status a) #

mimeUnrenderWithType :: Proxy JSON -> MediaType -> ByteString -> Either String (WithStatus _status a) #

MimeUnrender OctetStream a => MimeUnrender OctetStream (WithStatus _status a) 
Instance details

Defined in Servant.API.UVerb

Methods

mimeUnrender :: Proxy OctetStream -> ByteString -> Either String (WithStatus _status a) #

mimeUnrenderWithType :: Proxy OctetStream -> MediaType -> ByteString -> Either String (WithStatus _status a) #

MimeUnrender PlainText a => MimeUnrender PlainText (WithStatus _status a) 
Instance details

Defined in Servant.API.UVerb

Methods

mimeUnrender :: Proxy PlainText -> ByteString -> Either String (WithStatus _status a) #

mimeUnrenderWithType :: Proxy PlainText -> MediaType -> ByteString -> Either String (WithStatus _status a) #

data NoContent #

Constructors

NoContent 

Instances

Instances details
NFData NoContent 
Instance details

Defined in Servant.API.ContentTypes

Methods

rnf :: NoContent -> ()

Generic NoContent 
Instance details

Defined in Servant.API.ContentTypes

Associated Types

type Rep NoContent 
Instance details

Defined in Servant.API.ContentTypes

type Rep NoContent = D1 ('MetaData "NoContent" "Servant.API.ContentTypes" "servant-0.20.2-Dpi2iKtDCNG45viqOW9pMM" 'False) (C1 ('MetaCons "NoContent" 'PrefixI 'False) (U1 :: Type -> Type))

Methods

from :: NoContent -> Rep NoContent x

to :: Rep NoContent x -> NoContent

Read NoContent 
Instance details

Defined in Servant.API.ContentTypes

Methods

readsPrec :: Int -> ReadS NoContent

readList :: ReadS [NoContent]

readPrec :: ReadPrec NoContent

readListPrec :: ReadPrec [NoContent]

Show NoContent 
Instance details

Defined in Servant.API.ContentTypes

Methods

showsPrec :: Int -> NoContent -> ShowS

show :: NoContent -> String

showList :: [NoContent] -> ShowS

Eq NoContent 
Instance details

Defined in Servant.API.ContentTypes

Methods

(==) :: NoContent -> NoContent -> Bool

(/=) :: NoContent -> NoContent -> Bool

HasStatus NoContent 
Instance details

Defined in Servant.API.UVerb

Associated Types

type StatusOf NoContent 
Instance details

Defined in Servant.API.UVerb

type StatusOf NoContent = 204
AllMime (ctyp ': (ctyp' ': ctyps)) => AllMimeRender (ctyp ': (ctyp' ': ctyps)) NoContent 
Instance details

Defined in Servant.API.ContentTypes

Methods

allMimeRender :: Proxy (ctyp ': (ctyp' ': ctyps)) -> NoContent -> [(MediaType, ByteString)]

Accept ctyp => AllMimeRender '[ctyp] NoContent 
Instance details

Defined in Servant.API.ContentTypes

Methods

allMimeRender :: Proxy '[ctyp] -> NoContent -> [(MediaType, ByteString)]

type Rep NoContent 
Instance details

Defined in Servant.API.ContentTypes

type Rep NoContent = D1 ('MetaData "NoContent" "Servant.API.ContentTypes" "servant-0.20.2-Dpi2iKtDCNG45viqOW9pMM" 'False) (C1 ('MetaCons "NoContent" 'PrefixI 'False) (U1 :: Type -> Type))
type StatusOf NoContent 
Instance details

Defined in Servant.API.UVerb

type StatusOf NoContent = 204

class GetHeaders ls where #

Methods

getHeaders :: ls -> [Header] #

Instances

Instances details
GetHeadersFromHList hs => GetHeaders (HList hs) 
Instance details

Defined in Servant.API.ResponseHeaders

Methods

getHeaders :: HList hs -> [Header] #

GetHeaders' hs => GetHeaders (Headers hs a) 
Instance details

Defined in Servant.API.ResponseHeaders

Methods

getHeaders :: Headers hs a -> [Header] #

data Headers (ls :: [Type]) a #

Constructors

Headers 

Fields

Instances

Instances details
(KnownSymbol h, ToHttpApiData v) => AddHeader mods h v (Headers (fst ': rest) a) (Headers (Header' mods h v ': (fst ': rest)) a) 
Instance details

Defined in Servant.API.ResponseHeaders

Methods

addOptionalHeader :: ResponseHeader h v -> Headers (fst ': rest) a -> Headers (Header' mods h v ': (fst ': rest)) a

(IsServerResource cts a, GetHeaders (Headers h a)) => IsServerResource cts (Headers h a) Source # 
Instance details

Defined in Servant.Server.UVerb

Methods

resourceResponse :: Request -> Proxy cts -> Headers h a -> Maybe (ByteString, ByteString)

resourceHeaders :: Proxy cts -> Headers h a -> [(HeaderName, ByteString)]

(AllCTRender ctypes a, ReflectMethod method, KnownNat status, GetHeaders (Headers h a)) => HasServer (Verb method status ctypes (Headers h a) :: Type) context Source # 
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (Verb method status ctypes (Headers h a)) -> Context context -> Delayed env (Server (Verb method status ctypes (Headers h a))) -> Router env Source #

hoistServerWithContext :: Proxy (Verb method status ctypes (Headers h a)) -> Proxy context -> (forall x. m x -> n x) -> ServerT (Verb method status ctypes (Headers h a)) m -> ServerT (Verb method status ctypes (Headers h a)) n Source #

(MimeRender ctype chunk, ReflectMethod method, KnownNat status, FramingRender framing, ToSourceIO chunk a, GetHeaders (Headers h a)) => HasServer (Stream method status framing ctype (Headers h a) :: Type) context Source # 
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (Stream method status framing ctype (Headers h a)) -> Context context -> Delayed env (Server (Stream method status framing ctype (Headers h a))) -> Router env Source #

hoistServerWithContext :: Proxy (Stream method status framing ctype (Headers h a)) -> Proxy context -> (forall x. m x -> n x) -> ServerT (Stream method status framing ctype (Headers h a)) m -> ServerT (Stream method status framing ctype (Headers h a)) n Source #

Functor (Headers ls) 
Instance details

Defined in Servant.API.ResponseHeaders

Methods

fmap :: (a -> b) -> Headers ls a -> Headers ls b

(<$) :: a -> Headers ls b -> Headers ls a

(NFDataHList ls, NFData a) => NFData (Headers ls a) 
Instance details

Defined in Servant.API.ResponseHeaders

Methods

rnf :: Headers ls a -> ()

GetHeaders' hs => GetHeaders (Headers hs a) 
Instance details

Defined in Servant.API.ResponseHeaders

Methods

getHeaders :: Headers hs a -> [Header] #

HasStatus a => HasStatus (Headers ls a) 
Instance details

Defined in Servant.API.UVerb

Associated Types

type StatusOf (Headers ls a) 
Instance details

Defined in Servant.API.UVerb

type StatusOf (Headers ls a) = StatusOf a
type ServerT (Verb method status ctypes (Headers h a) :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (Verb method status ctypes (Headers h a) :: Type) m = m (Headers h a)
type ServerT (Stream method status framing ctype (Headers h a) :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (Stream method status framing ctype (Headers h a) :: Type) m = m (Headers h a)
type StatusOf (Headers ls a) 
Instance details

Defined in Servant.API.UVerb

type StatusOf (Headers ls a) = StatusOf a

class FromHttpApiData a where #

Minimal complete definition

parseUrlPiece | parseQueryParam

Methods

parseUrlPiece :: Text -> Either Text a #

parseHeader :: ByteString -> Either Text a #

parseQueryParam :: Text -> Either Text a #

Instances

Instances details
FromHttpApiData SetCookie 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text SetCookie #

parseHeader :: ByteString -> Either Text SetCookie #

parseQueryParam :: Text -> Either Text SetCookie #

FromHttpApiData Void 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text Void #

parseHeader :: ByteString -> Either Text Void #

parseQueryParam :: Text -> Either Text Void #

FromHttpApiData All 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text All #

parseHeader :: ByteString -> Either Text All #

parseQueryParam :: Text -> Either Text All #

FromHttpApiData Any 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text Any #

parseHeader :: ByteString -> Either Text Any #

parseQueryParam :: Text -> Either Text Any #

FromHttpApiData Version 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text Version #

parseHeader :: ByteString -> Either Text Version #

parseQueryParam :: Text -> Either Text Version #

FromHttpApiData Int16 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text Int16 #

parseHeader :: ByteString -> Either Text Int16 #

parseQueryParam :: Text -> Either Text Int16 #

FromHttpApiData Int32 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text Int32 #

parseHeader :: ByteString -> Either Text Int32 #

parseQueryParam :: Text -> Either Text Int32 #

FromHttpApiData Int64 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text Int64 #

parseHeader :: ByteString -> Either Text Int64 #

parseQueryParam :: Text -> Either Text Int64 #

FromHttpApiData Int8 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text Int8 #

parseHeader :: ByteString -> Either Text Int8 #

parseQueryParam :: Text -> Either Text Int8 #

FromHttpApiData Word16 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text Word16 #

parseHeader :: ByteString -> Either Text Word16 #

parseQueryParam :: Text -> Either Text Word16 #

FromHttpApiData Word32 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text Word32 #

parseHeader :: ByteString -> Either Text Word32 #

parseQueryParam :: Text -> Either Text Word32 #

FromHttpApiData Word64 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text Word64 #

parseHeader :: ByteString -> Either Text Word64 #

parseQueryParam :: Text -> Either Text Word64 #

FromHttpApiData Word8 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text Word8 #

parseHeader :: ByteString -> Either Text Word8 #

parseQueryParam :: Text -> Either Text Word8 #

FromHttpApiData Ordering 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text Ordering #

parseHeader :: ByteString -> Either Text Ordering #

parseQueryParam :: Text -> Either Text Ordering #

FromHttpApiData Text 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text Text #

parseHeader :: ByteString -> Either Text Text #

parseQueryParam :: Text -> Either Text Text #

FromHttpApiData Text 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text Text #

parseHeader :: ByteString -> Either Text Text #

parseQueryParam :: Text -> Either Text Text #

FromHttpApiData Day 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text Day #

parseHeader :: ByteString -> Either Text Day #

parseQueryParam :: Text -> Either Text Day #

FromHttpApiData Month 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text Month #

parseHeader :: ByteString -> Either Text Month #

parseQueryParam :: Text -> Either Text Month #

FromHttpApiData Quarter 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text Quarter #

parseHeader :: ByteString -> Either Text Quarter #

parseQueryParam :: Text -> Either Text Quarter #

FromHttpApiData QuarterOfYear 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text QuarterOfYear #

parseHeader :: ByteString -> Either Text QuarterOfYear #

parseQueryParam :: Text -> Either Text QuarterOfYear #

FromHttpApiData DayOfWeek 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text DayOfWeek #

parseHeader :: ByteString -> Either Text DayOfWeek #

parseQueryParam :: Text -> Either Text DayOfWeek #

FromHttpApiData NominalDiffTime 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text NominalDiffTime #

parseHeader :: ByteString -> Either Text NominalDiffTime #

parseQueryParam :: Text -> Either Text NominalDiffTime #

FromHttpApiData UTCTime 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text UTCTime #

parseHeader :: ByteString -> Either Text UTCTime #

parseQueryParam :: Text -> Either Text UTCTime #

FromHttpApiData LocalTime 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text LocalTime #

parseHeader :: ByteString -> Either Text LocalTime #

parseQueryParam :: Text -> Either Text LocalTime #

FromHttpApiData TimeOfDay 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text TimeOfDay #

parseHeader :: ByteString -> Either Text TimeOfDay #

parseQueryParam :: Text -> Either Text TimeOfDay #

FromHttpApiData ZonedTime 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text ZonedTime #

parseHeader :: ByteString -> Either Text ZonedTime #

parseQueryParam :: Text -> Either Text ZonedTime #

FromHttpApiData UUID 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text UUID #

parseHeader :: ByteString -> Either Text UUID #

parseQueryParam :: Text -> Either Text UUID #

FromHttpApiData Integer 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text Integer #

parseHeader :: ByteString -> Either Text Integer #

parseQueryParam :: Text -> Either Text Integer #

FromHttpApiData Natural 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text Natural #

parseHeader :: ByteString -> Either Text Natural #

parseQueryParam :: Text -> Either Text Natural #

FromHttpApiData String 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text String #

parseHeader :: ByteString -> Either Text String #

parseQueryParam :: Text -> Either Text String #

FromHttpApiData () 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text () #

parseHeader :: ByteString -> Either Text () #

parseQueryParam :: Text -> Either Text () #

FromHttpApiData Bool 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text Bool #

parseHeader :: ByteString -> Either Text Bool #

parseQueryParam :: Text -> Either Text Bool #

FromHttpApiData Char 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text Char #

parseHeader :: ByteString -> Either Text Char #

parseQueryParam :: Text -> Either Text Char #

FromHttpApiData Double 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text Double #

parseHeader :: ByteString -> Either Text Double #

parseQueryParam :: Text -> Either Text Double #

FromHttpApiData Float 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text Float #

parseHeader :: ByteString -> Either Text Float #

parseQueryParam :: Text -> Either Text Float #

FromHttpApiData Int 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text Int #

parseHeader :: ByteString -> Either Text Int #

parseQueryParam :: Text -> Either Text Int #

FromHttpApiData Word 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text Word #

parseHeader :: ByteString -> Either Text Word #

parseQueryParam :: Text -> Either Text Word #

FromHttpApiData a => FromHttpApiData (First a) 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text (First a) #

parseHeader :: ByteString -> Either Text (First a) #

parseQueryParam :: Text -> Either Text (First a) #

FromHttpApiData a => FromHttpApiData (Last a) 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text (Last a) #

parseHeader :: ByteString -> Either Text (Last a) #

parseQueryParam :: Text -> Either Text (Last a) #

FromHttpApiData a => FromHttpApiData (Max a) 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text (Max a) #

parseHeader :: ByteString -> Either Text (Max a) #

parseQueryParam :: Text -> Either Text (Max a) #

FromHttpApiData a => FromHttpApiData (Min a) 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text (Min a) #

parseHeader :: ByteString -> Either Text (Min a) #

parseQueryParam :: Text -> Either Text (Min a) #

FromHttpApiData a => FromHttpApiData (Identity a) 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text (Identity a) #

parseHeader :: ByteString -> Either Text (Identity a) #

parseQueryParam :: Text -> Either Text (Identity a) #

FromHttpApiData a => FromHttpApiData (First a) 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text (First a) #

parseHeader :: ByteString -> Either Text (First a) #

parseQueryParam :: Text -> Either Text (First a) #

FromHttpApiData a => FromHttpApiData (Last a) 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text (Last a) #

parseHeader :: ByteString -> Either Text (Last a) #

parseQueryParam :: Text -> Either Text (Last a) #

FromHttpApiData a => FromHttpApiData (Dual a) 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text (Dual a) #

parseHeader :: ByteString -> Either Text (Dual a) #

parseQueryParam :: Text -> Either Text (Dual a) #

FromHttpApiData a => FromHttpApiData (Product a) 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text (Product a) #

parseHeader :: ByteString -> Either Text (Product a) #

parseQueryParam :: Text -> Either Text (Product a) #

FromHttpApiData a => FromHttpApiData (Sum a) 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text (Sum a) #

parseHeader :: ByteString -> Either Text (Sum a) #

parseQueryParam :: Text -> Either Text (Sum a) #

FromHttpApiData a => FromHttpApiData (LenientData a) 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text (LenientData a) #

parseHeader :: ByteString -> Either Text (LenientData a) #

parseQueryParam :: Text -> Either Text (LenientData a) #

FromHttpApiData a => FromHttpApiData (Maybe a) 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text (Maybe a) #

parseHeader :: ByteString -> Either Text (Maybe a) #

parseQueryParam :: Text -> Either Text (Maybe a) #

HasResolution a => FromHttpApiData (Fixed a) 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text (Fixed a) #

parseHeader :: ByteString -> Either Text (Fixed a) #

parseQueryParam :: Text -> Either Text (Fixed a) #

(FromHttpApiData a, FromHttpApiData b) => FromHttpApiData (Either a b) 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text (Either a b) #

parseHeader :: ByteString -> Either Text (Either a b) #

parseQueryParam :: Text -> Either Text (Either a b) #

FromHttpApiData a => FromHttpApiData (Const a b) 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text (Const a b) #

parseHeader :: ByteString -> Either Text (Const a b) #

parseQueryParam :: Text -> Either Text (Const a b) #

FromHttpApiData a => FromHttpApiData (Tagged b a) 
Instance details

Defined in Web.Internal.HttpApiData

Methods

parseUrlPiece :: Text -> Either Text (Tagged b a) #

parseHeader :: ByteString -> Either Text (Tagged b a) #

parseQueryParam :: Text -> Either Text (Tagged b a) #

data BasicAuthData #

Constructors

BasicAuthData 

Fields

type Capture = Capture' ('[] :: [Type]) #

class KnownStatus (StatusOf a) => HasStatus a #

Associated Types

type StatusOf a :: Nat #

Instances

Instances details
HasStatus NoContent 
Instance details

Defined in Servant.API.UVerb

Associated Types

type StatusOf NoContent 
Instance details

Defined in Servant.API.UVerb

type StatusOf NoContent = 204
HasStatus a => HasStatus (Headers ls a) 
Instance details

Defined in Servant.API.UVerb

Associated Types

type StatusOf (Headers ls a) 
Instance details

Defined in Servant.API.UVerb

type StatusOf (Headers ls a) = StatusOf a
KnownStatus n => HasStatus (WithStatus n a) 
Instance details

Defined in Servant.API.UVerb

Associated Types

type StatusOf (WithStatus n a) 
Instance details

Defined in Servant.API.UVerb

type StatusOf (WithStatus n a) = n

type IsMember (a :: u) (as :: [u]) = (Unique as, CheckElemIsMember a as, UElem a as) #

type family Statuses (as :: [Type]) :: [Nat] #

Instances

Instances details
type Statuses ('[] :: [Type]) 
Instance details

Defined in Servant.API.UVerb

type Statuses ('[] :: [Type]) = '[] :: [Nat]
type Statuses (a ': as) 
Instance details

Defined in Servant.API.UVerb

type Statuses (a ': as) = StatusOf a ': Statuses as

type family Statuses (as :: [Type]) :: [Nat] #

Instances

Instances details
type Statuses ('[] :: [Type]) 
Instance details

Defined in Servant.API.UVerb

type Statuses ('[] :: [Type]) = '[] :: [Nat]
type Statuses (a ': as) 
Instance details

Defined in Servant.API.UVerb

type Statuses (a ': as) = StatusOf a ': Statuses as

type Union = NS I #

type family Unique (xs :: [k]) where ... #

Equations

Unique (xs :: [k]) = If (Nubbed xs == 'True) () (TypeError (DuplicateElementError xs) :: Constraint) 

newtype WithStatus (k :: Nat) a #

Constructors

WithStatus a 

Instances

Instances details
MimeRender FormUrlEncoded a => MimeRender FormUrlEncoded (WithStatus _status a) 
Instance details

Defined in Servant.API.UVerb

Methods

mimeRender :: Proxy FormUrlEncoded -> WithStatus _status a -> ByteString #

MimeRender JSON a => MimeRender JSON (WithStatus _status a) 
Instance details

Defined in Servant.API.UVerb

Methods

mimeRender :: Proxy JSON -> WithStatus _status a -> ByteString #

MimeRender OctetStream a => MimeRender OctetStream (WithStatus _status a) 
Instance details

Defined in Servant.API.UVerb

Methods

mimeRender :: Proxy OctetStream -> WithStatus _status a -> ByteString #

MimeRender PlainText a => MimeRender PlainText (WithStatus _status a) 
Instance details

Defined in Servant.API.UVerb

Methods

mimeRender :: Proxy PlainText -> WithStatus _status a -> ByteString #

MimeUnrender FormUrlEncoded a => MimeUnrender FormUrlEncoded (WithStatus _status a) 
Instance details

Defined in Servant.API.UVerb

Methods

mimeUnrender :: Proxy FormUrlEncoded -> ByteString -> Either String (WithStatus _status a) #

mimeUnrenderWithType :: Proxy FormUrlEncoded -> MediaType -> ByteString -> Either String (WithStatus _status a) #

MimeUnrender JSON a => MimeUnrender JSON (WithStatus _status a) 
Instance details

Defined in Servant.API.UVerb

Methods

mimeUnrender :: Proxy JSON -> ByteString -> Either String (WithStatus _status a) #

mimeUnrenderWithType :: Proxy JSON -> MediaType -> ByteString -> Either String (WithStatus _status a) #

MimeUnrender OctetStream a => MimeUnrender OctetStream (WithStatus _status a) 
Instance details

Defined in Servant.API.UVerb

Methods

mimeUnrender :: Proxy OctetStream -> ByteString -> Either String (WithStatus _status a) #

mimeUnrenderWithType :: Proxy OctetStream -> MediaType -> ByteString -> Either String (WithStatus _status a) #

MimeUnrender PlainText a => MimeUnrender PlainText (WithStatus _status a) 
Instance details

Defined in Servant.API.UVerb

Methods

mimeUnrender :: Proxy PlainText -> ByteString -> Either String (WithStatus _status a) #

mimeUnrenderWithType :: Proxy PlainText -> MediaType -> ByteString -> Either String (WithStatus _status a) #

IsServerResource cts a => IsServerResource cts (WithStatus n a) Source # 
Instance details

Defined in Servant.Server.UVerb

Methods

resourceResponse :: Request -> Proxy cts -> WithStatus n a -> Maybe (ByteString, ByteString)

resourceHeaders :: Proxy cts -> WithStatus n a -> [(HeaderName, ByteString)]

Show a => Show (WithStatus k a) 
Instance details

Defined in Servant.API.UVerb

Methods

showsPrec :: Int -> WithStatus k a -> ShowS

show :: WithStatus k a -> String

showList :: [WithStatus k a] -> ShowS

Eq a => Eq (WithStatus k a) 
Instance details

Defined in Servant.API.UVerb

Methods

(==) :: WithStatus k a -> WithStatus k a -> Bool

(/=) :: WithStatus k a -> WithStatus k a -> Bool

KnownStatus n => HasStatus (WithStatus n a) 
Instance details

Defined in Servant.API.UVerb

Associated Types

type StatusOf (WithStatus n a) 
Instance details

Defined in Servant.API.UVerb

type StatusOf (WithStatus n a) = n
type StatusOf (WithStatus n a) 
Instance details

Defined in Servant.API.UVerb

type StatusOf (WithStatus n a) = n

inject :: UElem x xs => f x -> NS f xs #

statusOf :: HasStatus a => proxy a -> Status #

data StdMethod #

Constructors

GET 
POST 
HEAD 
PUT 
DELETE 
TRACE 
CONNECT 
OPTIONS 
PATCH 

Instances

Instances details
Data StdMethod 
Instance details

Defined in Network.HTTP.Types.Method

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> StdMethod -> c StdMethod

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c StdMethod

toConstr :: StdMethod -> Constr

dataTypeOf :: StdMethod -> DataType

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c StdMethod)

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c StdMethod)

gmapT :: (forall b. Data b => b -> b) -> StdMethod -> StdMethod

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> StdMethod -> r

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> StdMethod -> r

gmapQ :: (forall d. Data d => d -> u) -> StdMethod -> [u]

gmapQi :: Int -> (forall d. Data d => d -> u) -> StdMethod -> u

gmapM :: Monad m => (forall d. Data d => d -> m d) -> StdMethod -> m StdMethod

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> StdMethod -> m StdMethod

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> StdMethod -> m StdMethod

Bounded StdMethod 
Instance details

Defined in Network.HTTP.Types.Method

Enum StdMethod 
Instance details

Defined in Network.HTTP.Types.Method

Generic StdMethod 
Instance details

Defined in Network.HTTP.Types.Method

Associated Types

type Rep StdMethod 
Instance details

Defined in Network.HTTP.Types.Method

type Rep StdMethod = D1 ('MetaData "StdMethod" "Network.HTTP.Types.Method" "http-types-0.12.4-GJHVJ4o7poWCoEEi7gy1ZH" 'False) (((C1 ('MetaCons "GET" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "POST" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "HEAD" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "PUT" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "DELETE" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TRACE" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "CONNECT" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "OPTIONS" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "PATCH" 'PrefixI 'False) (U1 :: Type -> Type)))))

Methods

from :: StdMethod -> Rep StdMethod x

to :: Rep StdMethod x -> StdMethod

Ix StdMethod 
Instance details

Defined in Network.HTTP.Types.Method

Read StdMethod 
Instance details

Defined in Network.HTTP.Types.Method

Methods

readsPrec :: Int -> ReadS StdMethod

readList :: ReadS [StdMethod]

readPrec :: ReadPrec StdMethod

readListPrec :: ReadPrec [StdMethod]

Show StdMethod 
Instance details

Defined in Network.HTTP.Types.Method

Methods

showsPrec :: Int -> StdMethod -> ShowS

show :: StdMethod -> String

showList :: [StdMethod] -> ShowS

Eq StdMethod 
Instance details

Defined in Network.HTTP.Types.Method

Methods

(==) :: StdMethod -> StdMethod -> Bool

(/=) :: StdMethod -> StdMethod -> Bool

Ord StdMethod 
Instance details

Defined in Network.HTTP.Types.Method

Methods

compare :: StdMethod -> StdMethod -> Ordering

(<) :: StdMethod -> StdMethod -> Bool

(<=) :: StdMethod -> StdMethod -> Bool

(>) :: StdMethod -> StdMethod -> Bool

(>=) :: StdMethod -> StdMethod -> Bool

max :: StdMethod -> StdMethod -> StdMethod

min :: StdMethod -> StdMethod -> StdMethod

ReflectMethod 'CONNECT 
Instance details

Defined in Servant.API.Verbs

Methods

reflectMethod :: Proxy 'CONNECT -> Method #

ReflectMethod 'DELETE 
Instance details

Defined in Servant.API.Verbs

Methods

reflectMethod :: Proxy 'DELETE -> Method #

ReflectMethod 'GET 
Instance details

Defined in Servant.API.Verbs

Methods

reflectMethod :: Proxy 'GET -> Method #

ReflectMethod 'HEAD 
Instance details

Defined in Servant.API.Verbs

Methods

reflectMethod :: Proxy 'HEAD -> Method #

ReflectMethod 'OPTIONS 
Instance details

Defined in Servant.API.Verbs

Methods

reflectMethod :: Proxy 'OPTIONS -> Method #

ReflectMethod 'PATCH 
Instance details

Defined in Servant.API.Verbs

Methods

reflectMethod :: Proxy 'PATCH -> Method #

ReflectMethod 'POST 
Instance details

Defined in Servant.API.Verbs

Methods

reflectMethod :: Proxy 'POST -> Method #

ReflectMethod 'PUT 
Instance details

Defined in Servant.API.Verbs

Methods

reflectMethod :: Proxy 'PUT -> Method #

ReflectMethod 'TRACE 
Instance details

Defined in Servant.API.Verbs

Methods

reflectMethod :: Proxy 'TRACE -> Method #

type Rep StdMethod 
Instance details

Defined in Network.HTTP.Types.Method

type Rep StdMethod = D1 ('MetaData "StdMethod" "Network.HTTP.Types.Method" "http-types-0.12.4-GJHVJ4o7poWCoEEi7gy1ZH" 'False) (((C1 ('MetaCons "GET" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "POST" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "HEAD" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "PUT" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "DELETE" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TRACE" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "CONNECT" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "OPTIONS" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "PATCH" 'PrefixI 'False) (U1 :: Type -> Type)))))

data HttpVersion #

Constructors

HttpVersion 

Fields

Instances

Instances details
Data HttpVersion 
Instance details

Defined in Network.HTTP.Types.Version

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> HttpVersion -> c HttpVersion

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c HttpVersion

toConstr :: HttpVersion -> Constr

dataTypeOf :: HttpVersion -> DataType

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c HttpVersion)

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c HttpVersion)

gmapT :: (forall b. Data b => b -> b) -> HttpVersion -> HttpVersion

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> HttpVersion -> r

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> HttpVersion -> r

gmapQ :: (forall d. Data d => d -> u) -> HttpVersion -> [u]

gmapQi :: Int -> (forall d. Data d => d -> u) -> HttpVersion -> u

gmapM :: Monad m => (forall d. Data d => d -> m d) -> HttpVersion -> m HttpVersion

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> HttpVersion -> m HttpVersion

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> HttpVersion -> m HttpVersion

Generic HttpVersion 
Instance details

Defined in Network.HTTP.Types.Version

Associated Types

type Rep HttpVersion 
Instance details

Defined in Network.HTTP.Types.Version

type Rep HttpVersion = D1 ('MetaData "HttpVersion" "Network.HTTP.Types.Version" "http-types-0.12.4-GJHVJ4o7poWCoEEi7gy1ZH" 'False) (C1 ('MetaCons "HttpVersion" 'PrefixI 'True) (S1 ('MetaSel ('Just "httpMajor") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Int) :*: S1 ('MetaSel ('Just "httpMinor") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Int)))

Methods

from :: HttpVersion -> Rep HttpVersion x

to :: Rep HttpVersion x -> HttpVersion

Show HttpVersion 
Instance details

Defined in Network.HTTP.Types.Version

Methods

showsPrec :: Int -> HttpVersion -> ShowS

show :: HttpVersion -> String

showList :: [HttpVersion] -> ShowS

Eq HttpVersion 
Instance details

Defined in Network.HTTP.Types.Version

Methods

(==) :: HttpVersion -> HttpVersion -> Bool

(/=) :: HttpVersion -> HttpVersion -> Bool

Ord HttpVersion 
Instance details

Defined in Network.HTTP.Types.Version

HasLink sub => HasLink (HttpVersion :> sub :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a) -> Proxy (HttpVersion :> sub) -> Link -> MkLink (HttpVersion :> sub) a #

HasServer api context => HasServer (HttpVersion :> api :: Type) context Source # 
Instance details

Defined in Servant.Server.Internal

Methods

route :: Proxy (HttpVersion :> api) -> Context context -> Delayed env (Server (HttpVersion :> api)) -> Router env Source #

hoistServerWithContext :: Proxy (HttpVersion :> api) -> Proxy context -> (forall x. m x -> n x) -> ServerT (HttpVersion :> api) m -> ServerT (HttpVersion :> api) n Source #

type Rep HttpVersion 
Instance details

Defined in Network.HTTP.Types.Version

type Rep HttpVersion = D1 ('MetaData "HttpVersion" "Network.HTTP.Types.Version" "http-types-0.12.4-GJHVJ4o7poWCoEEi7gy1ZH" 'False) (C1 ('MetaCons "HttpVersion" 'PrefixI 'True) (S1 ('MetaSel ('Just "httpMajor") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Int) :*: S1 ('MetaSel ('Just "httpMinor") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Int)))
type MkLink (HttpVersion :> sub :: Type) a 
Instance details

Defined in Servant.Links

type MkLink (HttpVersion :> sub :: Type) a = MkLink sub a
type ServerT (HttpVersion :> api :: Type) m Source # 
Instance details

Defined in Servant.Server.Internal

type ServerT (HttpVersion :> api :: Type) m = HttpVersion -> ServerT api m

type Get = Verb 'GET 200 #

type Put = Verb 'PUT 200 #

data Strict #

data FormUrlEncoded #

Instances

Instances details
Accept FormUrlEncoded 
Instance details

Defined in Servant.API.ContentTypes

Methods

contentType :: Proxy FormUrlEncoded -> MediaType #

contentTypes :: Proxy FormUrlEncoded -> NonEmpty MediaType #

ToForm a => MimeRender FormUrlEncoded a 
Instance details

Defined in Servant.API.ContentTypes

Methods

mimeRender :: Proxy FormUrlEncoded -> a -> ByteString #

FromForm a => MimeUnrender FormUrlEncoded a 
Instance details

Defined in Servant.API.ContentTypes

Methods

mimeUnrender :: Proxy FormUrlEncoded -> ByteString -> Either String a #

mimeUnrenderWithType :: Proxy FormUrlEncoded -> MediaType -> ByteString -> Either String a #

MimeRender FormUrlEncoded a => MimeRender FormUrlEncoded (WithStatus _status a) 
Instance details

Defined in Servant.API.UVerb

Methods

mimeRender :: Proxy FormUrlEncoded -> WithStatus _status a -> ByteString #

MimeUnrender FormUrlEncoded a => MimeUnrender FormUrlEncoded (WithStatus _status a) 
Instance details

Defined in Servant.API.UVerb

Methods

mimeUnrender :: Proxy FormUrlEncoded -> ByteString -> Either String (WithStatus _status a) #

mimeUnrenderWithType :: Proxy FormUrlEncoded -> MediaType -> ByteString -> Either String (WithStatus _status a) #

data JSON #

Instances

Instances details
Accept JSON 
Instance details

Defined in Servant.API.ContentTypes

Methods

contentType :: Proxy JSON -> MediaType #

contentTypes :: Proxy JSON -> NonEmpty MediaType #

ToJSON a => MimeRender JSON a 
Instance details

Defined in Servant.API.ContentTypes

Methods

mimeRender :: Proxy JSON -> a -> ByteString #

FromJSON a => MimeUnrender JSON a 
Instance details

Defined in Servant.API.ContentTypes

Methods

mimeUnrender :: Proxy JSON -> ByteString -> Either String a #

mimeUnrenderWithType :: Proxy JSON -> MediaType -> ByteString -> Either String a #

MimeRender JSON a => MimeRender JSON (WithStatus _status a) 
Instance details

Defined in Servant.API.UVerb

Methods

mimeRender :: Proxy JSON -> WithStatus _status a -> ByteString #

MimeUnrender JSON a => MimeUnrender JSON (WithStatus _status a) 
Instance details

Defined in Servant.API.UVerb

Methods

mimeUnrender :: Proxy JSON -> ByteString -> Either String (WithStatus _status a) #

mimeUnrenderWithType :: Proxy JSON -> MediaType -> ByteString -> Either String (WithStatus _status a) #

data OctetStream #

Instances

Instances details
Accept OctetStream 
Instance details

Defined in Servant.API.ContentTypes

Methods

contentType :: Proxy OctetStream -> MediaType #

contentTypes :: Proxy OctetStream -> NonEmpty MediaType #

MimeRender OctetStream ByteString 
Instance details

Defined in Servant.API.ContentTypes

Methods

mimeRender :: Proxy OctetStream -> ByteString -> ByteString #

MimeRender OctetStream ByteString 
Instance details

Defined in Servant.API.ContentTypes

Methods

mimeRender :: Proxy OctetStream -> ByteString -> ByteString #

MimeUnrender OctetStream ByteString 
Instance details

Defined in Servant.API.ContentTypes

Methods

mimeUnrender :: Proxy OctetStream -> ByteString -> Either String ByteString #

mimeUnrenderWithType :: Proxy OctetStream -> MediaType -> ByteString -> Either String ByteString #

MimeUnrender OctetStream ByteString 
Instance details

Defined in Servant.API.ContentTypes

Methods

mimeUnrender :: Proxy OctetStream -> ByteString -> Either String ByteString #

mimeUnrenderWithType :: Proxy OctetStream -> MediaType -> ByteString -> Either String ByteString #

MimeRender OctetStream a => MimeRender OctetStream (WithStatus _status a) 
Instance details

Defined in Servant.API.UVerb

Methods

mimeRender :: Proxy OctetStream -> WithStatus _status a -> ByteString #

MimeUnrender OctetStream a => MimeUnrender OctetStream (WithStatus _status a) 
Instance details

Defined in Servant.API.UVerb

Methods

mimeUnrender :: Proxy OctetStream -> ByteString -> Either String (WithStatus _status a) #

mimeUnrenderWithType :: Proxy OctetStream -> MediaType -> ByteString -> Either String (WithStatus _status a) #

data PlainText #

Instances

Instances details
Accept PlainText 
Instance details

Defined in Servant.API.ContentTypes

Methods

contentType :: Proxy PlainText -> MediaType #

contentTypes :: Proxy PlainText -> NonEmpty MediaType #

MimeRender PlainText Text 
Instance details

Defined in Servant.API.ContentTypes

Methods

mimeRender :: Proxy PlainText -> Text -> ByteString #

MimeRender PlainText Text 
Instance details

Defined in Servant.API.ContentTypes

Methods

mimeRender :: Proxy PlainText -> Text -> ByteString #

MimeRender PlainText String 
Instance details

Defined in Servant.API.ContentTypes

Methods

mimeRender :: Proxy PlainText -> String -> ByteString #

MimeUnrender PlainText Text 
Instance details

Defined in Servant.API.ContentTypes

Methods

mimeUnrender :: Proxy PlainText -> ByteString -> Either String Text #

mimeUnrenderWithType :: Proxy PlainText -> MediaType -> ByteString -> Either String Text #

MimeUnrender PlainText Text 
Instance details

Defined in Servant.API.ContentTypes

Methods

mimeUnrender :: Proxy PlainText -> ByteString -> Either String Text #

mimeUnrenderWithType :: Proxy PlainText -> MediaType -> ByteString -> Either String Text #

MimeUnrender PlainText String 
Instance details

Defined in Servant.API.ContentTypes

Methods

mimeUnrender :: Proxy PlainText -> ByteString -> Either String String #

mimeUnrenderWithType :: Proxy PlainText -> MediaType -> ByteString -> Either String String #

MimeRender PlainText a => MimeRender PlainText (WithStatus _status a) 
Instance details

Defined in Servant.API.UVerb

Methods

mimeRender :: Proxy PlainText -> WithStatus _status a -> ByteString #

MimeUnrender PlainText a => MimeUnrender PlainText (WithStatus _status a) 
Instance details

Defined in Servant.API.UVerb

Methods

mimeUnrender :: Proxy PlainText -> ByteString -> Either String (WithStatus _status a) #

mimeUnrenderWithType :: Proxy PlainText -> MediaType -> ByteString -> Either String (WithStatus _status a) #

data AuthProtect (tag :: k) #

Instances

Instances details
HasLink sub => HasLink (AuthProtect tag :> sub :: Type) 
Instance details

Defined in Servant.Links

Methods

toLink :: (Link -> a) -> Proxy (AuthProtect tag :> sub) -> Link -> MkLink (AuthProtect tag :> sub) a #

(HasServer api context, HasContextEntry context (AuthHandler Request (AuthServerData (AuthProtect tag)))) => HasServer (AuthProtect tag :> api :: Type) context Source #

Known orphan instance.

Instance details

Defined in Servant.Server.Experimental.Auth

Methods

route :: Proxy (AuthProtect tag :> api) -> Context context -> Delayed env (Server (AuthProtect tag :> api)) -> Router env Source #

hoistServerWithContext :: Proxy (AuthProtect tag :> api) -> Proxy context -> (forall x. m x -> n x) -> ServerT (AuthProtect tag :> api) m -> ServerT (AuthProtect tag :> api) n Source #

type MkLink (AuthProtect tag :> sub :: Type) a 
Instance details

Defined in Servant.Links

type MkLink (AuthProtect tag :> sub :: Type) a = MkLink sub a
type ServerT (AuthProtect tag :> api :: Type) m Source # 
Instance details

Defined in Servant.Server.Experimental.Auth

type ServerT (AuthProtect tag :> api :: Type) m = AuthServerData (AuthProtect tag) -> ServerT api m

type family (mode :: k) :- api #

Instances

Instances details
type AsApi :- api 
Instance details

Defined in Servant.API.Generic

type AsApi :- api = api
type (AsLink a :: Type) :- api 
Instance details

Defined in Servant.Links

type (AsLink a :: Type) :- api = MkLink api a
type (AsServerT m :: Type) :- api Source # 
Instance details

Defined in Servant.Server.Internal

type (AsServerT m :: Type) :- api = ServerT api m

data AsApi #

Instances

Instances details
GenericMode AsApi 
Instance details

Defined in Servant.API.Generic

Associated Types

type AsApi :- api 
Instance details

Defined in Servant.API.Generic

type AsApi :- api = api
type AsApi :- api 
Instance details

Defined in Servant.API.Generic

type AsApi :- api = api

type GenericServant (routes :: k -> Type) (mode :: k) = (GenericMode mode, Generic (routes mode), GServantProduct (Rep (routes mode))) #

genericApi :: forall (routes :: Type -> Type). GenericServant routes AsApi => Proxy routes -> Proxy (ToServantApi routes) #

data Lenient #

data Optional #

data Required #

class AddHeader (mods :: [Type]) (h :: Symbol) v orig new | mods h v orig -> new, new -> mods, new -> h, new -> v, new -> orig #

Minimal complete definition

addOptionalHeader

Instances

Instances details
(KnownSymbol h, ToHttpApiData v, new ~ Headers '[Header' mods h v] a) => AddHeader mods h v a new 
Instance details

Defined in Servant.API.ResponseHeaders

Methods

addOptionalHeader :: ResponseHeader h v -> a -> new

(AddHeader mods h v old new, AddHeader mods h v (Union oldrest) (Union newrest), oldrest ~ (a ': as), newrest ~ (b ': bs)) => AddHeader mods h v (Union (old ': (a ': as))) (Union (new ': (b ': bs))) 
Instance details

Defined in Servant.API.ResponseHeaders

Methods

addOptionalHeader :: ResponseHeader h v -> Union (old ': (a ': as)) -> Union (new ': (b ': bs))

AddHeader mods h v old new => AddHeader mods h v (Union '[old]) (Union '[new]) 
Instance details

Defined in Servant.API.ResponseHeaders

Methods

addOptionalHeader :: ResponseHeader h v -> Union '[old] -> Union '[new]

(KnownSymbol h, ToHttpApiData v) => AddHeader mods h v (Headers (fst ': rest) a) (Headers (Header' mods h v ': (fst ': rest)) a) 
Instance details

Defined in Servant.API.ResponseHeaders

Methods

addOptionalHeader :: ResponseHeader h v -> Headers (fst ': rest) a -> Headers (Header' mods h v ': (fst ': rest)) a

class BuildHeadersTo (hs :: [Type]) where #

Methods

buildHeadersTo :: [Header] -> HList hs #

Instances

Instances details
BuildHeadersTo ('[] :: [Type]) 
Instance details

Defined in Servant.API.ResponseHeaders

Methods

buildHeadersTo :: [Header] -> HList ('[] :: [Type]) #

(FromHttpApiData v, BuildHeadersTo xs, KnownSymbol h) => BuildHeadersTo (Header' mods h v ': xs) 
Instance details

Defined in Servant.API.ResponseHeaders

Methods

buildHeadersTo :: [Header] -> HList (Header' mods h v ': xs) #

data HList (a :: [Type]) where #

Constructors

HNil :: HList ('[] :: [Type]) 
HCons :: forall (h :: Symbol) x (xs :: [Type]) (mods :: [Type]). ResponseHeader h x -> HList xs -> HList (Header' mods h x ': xs) 

Instances

Instances details
NFDataHList xs => NFData (HList xs) 
Instance details

Defined in Servant.API.ResponseHeaders

Methods

rnf :: HList xs -> ()

GetHeadersFromHList hs => GetHeaders (HList hs) 
Instance details

Defined in Servant.API.ResponseHeaders

Methods

getHeaders :: HList hs -> [Header] #

class HasResponseHeader (h :: Symbol) a (headers :: [Type]) #

Minimal complete definition

hlistLookupHeader

Instances

Instances details
HasResponseHeader h a (Header' mods h a ': rest) 
Instance details

Defined in Servant.API.ResponseHeaders

Methods

hlistLookupHeader :: HList (Header' mods h a ': rest) -> ResponseHeader h a

HasResponseHeader h a rest => HasResponseHeader h a (first ': rest) 
Instance details

Defined in Servant.API.ResponseHeaders

Methods

hlistLookupHeader :: HList (first ': rest) -> ResponseHeader h a

addHeader :: forall (h :: Symbol) v orig new. AddHeader '[Optional, Strict] h v orig new => v -> orig -> new #

addHeader' :: forall (mods :: [Type]) (h :: Symbol) v orig new. AddHeader mods h v orig new => v -> orig -> new #

lookupResponseHeader :: forall (h :: Symbol) a (headers :: [Type]) r. HasResponseHeader h a headers => Headers headers r -> ResponseHeader h a #

noHeader :: forall (h :: Symbol) v orig new. AddHeader '[Optional, Strict] h v orig new => orig -> new #

noHeader' :: forall (mods :: [Type]) (h :: Symbol) v orig new. AddHeader mods h v orig new => orig -> new #

data NetstringFraming #

Instances

Instances details
FramingRender NetstringFraming 
Instance details

Defined in Servant.API.Stream

Methods

framingRender :: forall (m :: Type -> Type) a. Monad m => Proxy NetstringFraming -> (a -> ByteString) -> SourceT m a -> SourceT m ByteString #

FramingUnrender NetstringFraming 
Instance details

Defined in Servant.API.Stream

Methods

framingUnrender :: forall (m :: Type -> Type) a. Monad m => Proxy NetstringFraming -> (ByteString -> Either String a) -> SourceT m ByteString -> SourceT m a #

data NewlineFraming #

Instances

Instances details
FramingRender NewlineFraming 
Instance details

Defined in Servant.API.Stream

Methods

framingRender :: forall (m :: Type -> Type) a. Monad m => Proxy NewlineFraming -> (a -> ByteString) -> SourceT m a -> SourceT m ByteString #

FramingUnrender NewlineFraming 
Instance details

Defined in Servant.API.Stream

Methods

framingUnrender :: forall (m :: Type -> Type) a. Monad m => Proxy NewlineFraming -> (ByteString -> Either String a) -> SourceT m ByteString -> SourceT m a #

data NoFraming #

Instances

Instances details
FramingRender NoFraming 
Instance details

Defined in Servant.API.Stream

Methods

framingRender :: forall (m :: Type -> Type) a. Monad m => Proxy NoFraming -> (a -> ByteString) -> SourceT m a -> SourceT m ByteString #

FramingUnrender NoFraming 
Instance details

Defined in Servant.API.Stream

Methods

framingUnrender :: forall (m :: Type -> Type) a. Monad m => Proxy NoFraming -> (ByteString -> Either String a) -> SourceT m ByteString -> SourceT m a #

type StreamBody = StreamBody' ('[] :: [Type]) #

type StreamGet = Stream 'GET 200 #

type StreamPost = Stream 'POST 200 #

type family IsElem endpoint api where ... #

Equations

IsElem e (sa :<|> sb) = Or (IsElem e sa) (IsElem e sb) 
IsElem (e :> sa) (e :> sb) = IsElem sa sb 
IsElem sa (Header sym x :> sb) = IsElem sa sb 
IsElem sa (Header' mods sym x :> sb) = IsElem sa sb 
IsElem sa (ReqBody y x :> sb) = IsElem sa sb 
IsElem (CaptureAll z y :> sa) (CaptureAll x y :> sb) = IsElem sa sb 
IsElem (Capture z y :> sa) (Capture x y :> sb) = IsElem sa sb 
IsElem sa (QueryParam x y :> sb) = IsElem sa sb 
IsElem sa (QueryParams x y :> sb) = IsElem sa sb 
IsElem sa (QueryFlag x :> sb) = IsElem sa sb 
IsElem sa (Fragment x :> sb) = IsElem sa sb 
IsElem (Verb m s ct typ) (Verb m s ct' typ) = IsSubList ct ct' 
IsElem e e = () 
IsElem e (NamedRoutes rs) = IsElem e (ToServantApi rs) 
IsElem e a = IsElem' e a 

type family IsElem' a s #

type family StatusOf a :: Nat #

Instances

Instances details
type StatusOf NoContent 
Instance details

Defined in Servant.API.UVerb

type StatusOf NoContent = 204
type StatusOf (Headers ls a) 
Instance details

Defined in Servant.API.UVerb

type StatusOf (Headers ls a) = StatusOf a
type StatusOf (WithStatus n a) 
Instance details

Defined in Servant.API.UVerb

type StatusOf (WithStatus n a) = n

type Delete = Verb 'DELETE 200 #

type GetAccepted = Verb 'GET 202 #

type Patch = Verb 'PATCH 200 #

type Post = Verb 'POST 200 #

type PostAccepted = Verb 'POST 202 #

type PostCreated = Verb 'POST 201 #

type PutAccepted = Verb 'PUT 202 #

type PutCreated = Verb 'PUT 201 #

class HasLink (endpoint :: k) where #

Associated Types

type MkLink (endpoint :: k) a #

Methods

toLink :: (Link -> a) -> Proxy endpoint -> Link -> MkLink endpoint a #

Instances

data Link #

Instances

type family MkLink (endpoint :: k) a #

Instances

safeLink :: (IsElem endpoint api, HasLink endpoint) => Proxy api -> Proxy endpoint -> MkLink endpoint Link #

class ToHttpApiData a where #

Minimal complete definition

toUrlPiece | toQueryParam

Methods

toUrlPiece :: a -> Text #

toEncodedUrlPiece :: a -> Builder #

toHeader :: a -> ByteString #

toQueryParam :: a -> Text #

toEncodedQueryParam :: a -> Builder #

Instances

Instances details
ToHttpApiData SetCookie 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: SetCookie -> Text #

toEncodedUrlPiece :: SetCookie -> Builder #

toHeader :: SetCookie -> ByteString #

toQueryParam :: SetCookie -> Text #

toEncodedQueryParam :: SetCookie -> Builder #

ToHttpApiData Void 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: Void -> Text #

toEncodedUrlPiece :: Void -> Builder #

toHeader :: Void -> ByteString #

toQueryParam :: Void -> Text #

toEncodedQueryParam :: Void -> Builder #

ToHttpApiData All 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: All -> Text #

toEncodedUrlPiece :: All -> Builder #

toHeader :: All -> ByteString #

toQueryParam :: All -> Text #

toEncodedQueryParam :: All -> Builder #

ToHttpApiData Any 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: Any -> Text #

toEncodedUrlPiece :: Any -> Builder #

toHeader :: Any -> ByteString #

toQueryParam :: Any -> Text #

toEncodedQueryParam :: Any -> Builder #

ToHttpApiData Version 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: Version -> Text #

toEncodedUrlPiece :: Version -> Builder #

toHeader :: Version -> ByteString #

toQueryParam :: Version -> Text #

toEncodedQueryParam :: Version -> Builder #

ToHttpApiData Int16 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: Int16 -> Text #

toEncodedUrlPiece :: Int16 -> Builder #

toHeader :: Int16 -> ByteString #

toQueryParam :: Int16 -> Text #

toEncodedQueryParam :: Int16 -> Builder #

ToHttpApiData Int32 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: Int32 -> Text #

toEncodedUrlPiece :: Int32 -> Builder #

toHeader :: Int32 -> ByteString #

toQueryParam :: Int32 -> Text #

toEncodedQueryParam :: Int32 -> Builder #

ToHttpApiData Int64 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: Int64 -> Text #

toEncodedUrlPiece :: Int64 -> Builder #

toHeader :: Int64 -> ByteString #

toQueryParam :: Int64 -> Text #

toEncodedQueryParam :: Int64 -> Builder #

ToHttpApiData Int8 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: Int8 -> Text #

toEncodedUrlPiece :: Int8 -> Builder #

toHeader :: Int8 -> ByteString #

toQueryParam :: Int8 -> Text #

toEncodedQueryParam :: Int8 -> Builder #

ToHttpApiData Word16 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: Word16 -> Text #

toEncodedUrlPiece :: Word16 -> Builder #

toHeader :: Word16 -> ByteString #

toQueryParam :: Word16 -> Text #

toEncodedQueryParam :: Word16 -> Builder #

ToHttpApiData Word32 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: Word32 -> Text #

toEncodedUrlPiece :: Word32 -> Builder #

toHeader :: Word32 -> ByteString #

toQueryParam :: Word32 -> Text #

toEncodedQueryParam :: Word32 -> Builder #

ToHttpApiData Word64 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: Word64 -> Text #

toEncodedUrlPiece :: Word64 -> Builder #

toHeader :: Word64 -> ByteString #

toQueryParam :: Word64 -> Text #

toEncodedQueryParam :: Word64 -> Builder #

ToHttpApiData Word8 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: Word8 -> Text #

toEncodedUrlPiece :: Word8 -> Builder #

toHeader :: Word8 -> ByteString #

toQueryParam :: Word8 -> Text #

toEncodedQueryParam :: Word8 -> Builder #

ToHttpApiData Ordering 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: Ordering -> Text #

toEncodedUrlPiece :: Ordering -> Builder #

toHeader :: Ordering -> ByteString #

toQueryParam :: Ordering -> Text #

toEncodedQueryParam :: Ordering -> Builder #

ToHttpApiData Link 
Instance details

Defined in Servant.Links

Methods

toUrlPiece :: Link -> Text #

toEncodedUrlPiece :: Link -> Builder #

toHeader :: Link -> ByteString #

toQueryParam :: Link -> Text #

toEncodedQueryParam :: Link -> Builder #

ToHttpApiData Text 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: Text -> Text #

toEncodedUrlPiece :: Text -> Builder #

toHeader :: Text -> ByteString #

toQueryParam :: Text -> Text #

toEncodedQueryParam :: Text -> Builder #

ToHttpApiData Text 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: Text -> Text #

toEncodedUrlPiece :: Text -> Builder #

toHeader :: Text -> ByteString #

toQueryParam :: Text -> Text #

toEncodedQueryParam :: Text -> Builder #

ToHttpApiData Day 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: Day -> Text #

toEncodedUrlPiece :: Day -> Builder #

toHeader :: Day -> ByteString #

toQueryParam :: Day -> Text #

toEncodedQueryParam :: Day -> Builder #

ToHttpApiData Month 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: Month -> Text #

toEncodedUrlPiece :: Month -> Builder #

toHeader :: Month -> ByteString #

toQueryParam :: Month -> Text #

toEncodedQueryParam :: Month -> Builder #

ToHttpApiData Quarter 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: Quarter -> Text #

toEncodedUrlPiece :: Quarter -> Builder #

toHeader :: Quarter -> ByteString #

toQueryParam :: Quarter -> Text #

toEncodedQueryParam :: Quarter -> Builder #

ToHttpApiData QuarterOfYear 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: QuarterOfYear -> Text #

toEncodedUrlPiece :: QuarterOfYear -> Builder #

toHeader :: QuarterOfYear -> ByteString #

toQueryParam :: QuarterOfYear -> Text #

toEncodedQueryParam :: QuarterOfYear -> Builder #

ToHttpApiData DayOfWeek 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: DayOfWeek -> Text #

toEncodedUrlPiece :: DayOfWeek -> Builder #

toHeader :: DayOfWeek -> ByteString #

toQueryParam :: DayOfWeek -> Text #

toEncodedQueryParam :: DayOfWeek -> Builder #

ToHttpApiData NominalDiffTime 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: NominalDiffTime -> Text #

toEncodedUrlPiece :: NominalDiffTime -> Builder #

toHeader :: NominalDiffTime -> ByteString #

toQueryParam :: NominalDiffTime -> Text #

toEncodedQueryParam :: NominalDiffTime -> Builder #

ToHttpApiData UTCTime 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: UTCTime -> Text #

toEncodedUrlPiece :: UTCTime -> Builder #

toHeader :: UTCTime -> ByteString #

toQueryParam :: UTCTime -> Text #

toEncodedQueryParam :: UTCTime -> Builder #

ToHttpApiData LocalTime 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: LocalTime -> Text #

toEncodedUrlPiece :: LocalTime -> Builder #

toHeader :: LocalTime -> ByteString #

toQueryParam :: LocalTime -> Text #

toEncodedQueryParam :: LocalTime -> Builder #

ToHttpApiData TimeOfDay 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: TimeOfDay -> Text #

toEncodedUrlPiece :: TimeOfDay -> Builder #

toHeader :: TimeOfDay -> ByteString #

toQueryParam :: TimeOfDay -> Text #

toEncodedQueryParam :: TimeOfDay -> Builder #

ToHttpApiData ZonedTime 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: ZonedTime -> Text #

toEncodedUrlPiece :: ZonedTime -> Builder #

toHeader :: ZonedTime -> ByteString #

toQueryParam :: ZonedTime -> Text #

toEncodedQueryParam :: ZonedTime -> Builder #

ToHttpApiData UUID 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: UUID -> Text #

toEncodedUrlPiece :: UUID -> Builder #

toHeader :: UUID -> ByteString #

toQueryParam :: UUID -> Text #

toEncodedQueryParam :: UUID -> Builder #

ToHttpApiData Integer 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: Integer -> Text #

toEncodedUrlPiece :: Integer -> Builder #

toHeader :: Integer -> ByteString #

toQueryParam :: Integer -> Text #

toEncodedQueryParam :: Integer -> Builder #

ToHttpApiData Natural 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: Natural -> Text #

toEncodedUrlPiece :: Natural -> Builder #

toHeader :: Natural -> ByteString #

toQueryParam :: Natural -> Text #

toEncodedQueryParam :: Natural -> Builder #

ToHttpApiData String 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: String -> Text #

toEncodedUrlPiece :: String -> Builder #

toHeader :: String -> ByteString #

toQueryParam :: String -> Text #

toEncodedQueryParam :: String -> Builder #

ToHttpApiData () 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: () -> Text #

toEncodedUrlPiece :: () -> Builder #

toHeader :: () -> ByteString #

toQueryParam :: () -> Text #

toEncodedQueryParam :: () -> Builder #

ToHttpApiData Bool 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: Bool -> Text #

toEncodedUrlPiece :: Bool -> Builder #

toHeader :: Bool -> ByteString #

toQueryParam :: Bool -> Text #

toEncodedQueryParam :: Bool -> Builder #

ToHttpApiData Char 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: Char -> Text #

toEncodedUrlPiece :: Char -> Builder #

toHeader :: Char -> ByteString #

toQueryParam :: Char -> Text #

toEncodedQueryParam :: Char -> Builder #

ToHttpApiData Double 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: Double -> Text #

toEncodedUrlPiece :: Double -> Builder #

toHeader :: Double -> ByteString #

toQueryParam :: Double -> Text #

toEncodedQueryParam :: Double -> Builder #

ToHttpApiData Float 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: Float -> Text #

toEncodedUrlPiece :: Float -> Builder #

toHeader :: Float -> ByteString #

toQueryParam :: Float -> Text #

toEncodedQueryParam :: Float -> Builder #

ToHttpApiData Int 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: Int -> Text #

toEncodedUrlPiece :: Int -> Builder #

toHeader :: Int -> ByteString #

toQueryParam :: Int -> Text #

toEncodedQueryParam :: Int -> Builder #

ToHttpApiData Word 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: Word -> Text #

toEncodedUrlPiece :: Word -> Builder #

toHeader :: Word -> ByteString #

toQueryParam :: Word -> Text #

toEncodedQueryParam :: Word -> Builder #

ToHttpApiData a => ToHttpApiData (First a) 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: First a -> Text #

toEncodedUrlPiece :: First a -> Builder #

toHeader :: First a -> ByteString #

toQueryParam :: First a -> Text #

toEncodedQueryParam :: First a -> Builder #

ToHttpApiData a => ToHttpApiData (Last a) 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: Last a -> Text #

toEncodedUrlPiece :: Last a -> Builder #

toHeader :: Last a -> ByteString #

toQueryParam :: Last a -> Text #

toEncodedQueryParam :: Last a -> Builder #

ToHttpApiData a => ToHttpApiData (Max a) 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: Max a -> Text #

toEncodedUrlPiece :: Max a -> Builder #

toHeader :: Max a -> ByteString #

toQueryParam :: Max a -> Text #

toEncodedQueryParam :: Max a -> Builder #

ToHttpApiData a => ToHttpApiData (Min a) 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: Min a -> Text #

toEncodedUrlPiece :: Min a -> Builder #

toHeader :: Min a -> ByteString #

toQueryParam :: Min a -> Text #

toEncodedQueryParam :: Min a -> Builder #

ToHttpApiData a => ToHttpApiData (Identity a) 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: Identity a -> Text #

toEncodedUrlPiece :: Identity a -> Builder #

toHeader :: Identity a -> ByteString #

toQueryParam :: Identity a -> Text #

toEncodedQueryParam :: Identity a -> Builder #

ToHttpApiData a => ToHttpApiData (First a) 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: First a -> Text #

toEncodedUrlPiece :: First a -> Builder #

toHeader :: First a -> ByteString #

toQueryParam :: First a -> Text #

toEncodedQueryParam :: First a -> Builder #

ToHttpApiData a => ToHttpApiData (Last a) 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: Last a -> Text #

toEncodedUrlPiece :: Last a -> Builder #

toHeader :: Last a -> ByteString #

toQueryParam :: Last a -> Text #

toEncodedQueryParam :: Last a -> Builder #

ToHttpApiData a => ToHttpApiData (Dual a) 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: Dual a -> Text #

toEncodedUrlPiece :: Dual a -> Builder #

toHeader :: Dual a -> ByteString #

toQueryParam :: Dual a -> Text #

toEncodedQueryParam :: Dual a -> Builder #

ToHttpApiData a => ToHttpApiData (Product a) 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: Product a -> Text #

toEncodedUrlPiece :: Product a -> Builder #

toHeader :: Product a -> ByteString #

toQueryParam :: Product a -> Text #

toEncodedQueryParam :: Product a -> Builder #

ToHttpApiData a => ToHttpApiData (Sum a) 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: Sum a -> Text #

toEncodedUrlPiece :: Sum a -> Builder #

toHeader :: Sum a -> ByteString #

toQueryParam :: Sum a -> Text #

toEncodedQueryParam :: Sum a -> Builder #

ToHttpApiData a => ToHttpApiData (Maybe a) 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: Maybe a -> Text #

toEncodedUrlPiece :: Maybe a -> Builder #

toHeader :: Maybe a -> ByteString #

toQueryParam :: Maybe a -> Text #

toEncodedQueryParam :: Maybe a -> Builder #

HasResolution a => ToHttpApiData (Fixed a) 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: Fixed a -> Text #

toEncodedUrlPiece :: Fixed a -> Builder #

toHeader :: Fixed a -> ByteString #

toQueryParam :: Fixed a -> Text #

toEncodedQueryParam :: Fixed a -> Builder #

(ToHttpApiData a, ToHttpApiData b) => ToHttpApiData (Either a b) 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: Either a b -> Text #

toEncodedUrlPiece :: Either a b -> Builder #

toHeader :: Either a b -> ByteString #

toQueryParam :: Either a b -> Text #

toEncodedQueryParam :: Either a b -> Builder #

ToHttpApiData a => ToHttpApiData (Const a b) 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: Const a b -> Text #

toEncodedUrlPiece :: Const a b -> Builder #

toHeader :: Const a b -> ByteString #

toQueryParam :: Const a b -> Text #

toEncodedQueryParam :: Const a b -> Builder #

ToHttpApiData a => ToHttpApiData (Tagged b a) 
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: Tagged b a -> Text #

toEncodedUrlPiece :: Tagged b a -> Builder #

toHeader :: Tagged b a -> ByteString #

toQueryParam :: Tagged b a -> Text #

toEncodedQueryParam :: Tagged b a -> Builder #

data URI #

Constructors

URI 

Fields

Instances

Instances details
NFData URI 
Instance details

Defined in Network.URI

Methods

rnf :: URI -> ()

Data URI 
Instance details

Defined in Network.URI

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> URI -> c URI

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c URI

toConstr :: URI -> Constr

dataTypeOf :: URI -> DataType

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c URI)

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c URI)

gmapT :: (forall b. Data b => b -> b) -> URI -> URI

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> URI -> r

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> URI -> r

gmapQ :: (forall d. Data d => d -> u) -> URI -> [u]

gmapQi :: Int -> (forall d. Data d => d -> u) -> URI -> u

gmapM :: Monad m => (forall d. Data d => d -> m d) -> URI -> m URI

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> URI -> m URI

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> URI -> m URI

Generic URI 
Instance details

Defined in Network.URI

Associated Types

type Rep URI 
Instance details

Defined in Network.URI

type Rep URI = D1 ('MetaData "URI" "Network.URI" "network-uri-2.6.4.2-GTqI74Lt4lJDBgalj7yv6f" 'False) (C1 ('MetaCons "URI" 'PrefixI 'True) ((S1 ('MetaSel ('Just "uriScheme") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just "uriAuthority") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe URIAuth))) :*: (S1 ('MetaSel ('Just "uriPath") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: (S1 ('MetaSel ('Just "uriQuery") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just "uriFragment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))))

Methods

from :: URI -> Rep URI x

to :: Rep URI x -> URI

Show URI 
Instance details

Defined in Network.URI

Methods

showsPrec :: Int -> URI -> ShowS

show :: URI -> String

showList :: [URI] -> ShowS

Eq URI 
Instance details

Defined in Network.URI

Methods

(==) :: URI -> URI -> Bool

(/=) :: URI -> URI -> Bool

Ord URI 
Instance details

Defined in Network.URI

Methods

compare :: URI -> URI -> Ordering

(<) :: URI -> URI -> Bool

(<=) :: URI -> URI -> Bool

(>) :: URI -> URI -> Bool

(>=) :: URI -> URI -> Bool

max :: URI -> URI -> URI

min :: URI -> URI -> URI

Lift URI 
Instance details

Defined in Network.URI

Methods

lift :: Quote m => URI -> m Exp

liftTyped :: forall (m :: Type -> Type). Quote m => URI -> Code m URI

type Rep URI 
Instance details

Defined in Network.URI

type Rep URI = D1 ('MetaData "URI" "Network.URI" "network-uri-2.6.4.2-GTqI74Lt4lJDBgalj7yv6f" 'False) (C1 ('MetaCons "URI" 'PrefixI 'True) ((S1 ('MetaSel ('Just "uriScheme") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just "uriAuthority") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe URIAuth))) :*: (S1 ('MetaSel ('Just "uriPath") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: (S1 ('MetaSel ('Just "uriQuery") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just "uriFragment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))))

For implementing servers for servant APIs.

Utilities on top of the servant core

class FragmentUnique api => AtMostOneFragment api #

Instances

Instances details
AtMostOneFragment (Fragment a) 
Instance details

Defined in Servant.API.TypeLevel

AtMostOneFragment (UVerb m cts as) 
Instance details

Defined in Servant.API.TypeLevel

AtMostOneFragment (Verb m s ct typ) 
Instance details

Defined in Servant.API.TypeLevel

type family FragmentUnique api where ... #

Equations

FragmentUnique (sa :<|> sb) = And (FragmentUnique sa) (FragmentUnique sb) 
FragmentUnique (Fragment a :> sa) = FragmentNotIn sa (Fragment a :> sa) 
FragmentUnique (x :> sa) = FragmentUnique sa 
FragmentUnique (Fragment a) = () 
FragmentUnique x = () 

type family And a b where ... #

Equations

And () () = () 

type Elem (e :: t) (es :: [t]) = ElemGo e es es #

type family IsElem endpoint api where ... #

Equations

IsElem e (sa :<|> sb) = Or (IsElem e sa) (IsElem e sb) 
IsElem (e :> sa) (e :> sb) = IsElem sa sb 
IsElem sa (Header sym x :> sb) = IsElem sa sb 
IsElem sa (Header' mods sym x :> sb) = IsElem sa sb 
IsElem sa (ReqBody y x :> sb) = IsElem sa sb 
IsElem (CaptureAll z y :> sa) (CaptureAll x y :> sb) = IsElem sa sb 
IsElem (Capture z y :> sa) (Capture x y :> sb) = IsElem sa sb 
IsElem sa (QueryParam x y :> sb) = IsElem sa sb 
IsElem sa (QueryParams x y :> sb) = IsElem sa sb 
IsElem sa (QueryFlag x :> sb) = IsElem sa sb 
IsElem sa (Fragment x :> sb) = IsElem sa sb 
IsElem (Verb m s ct typ) (Verb m s ct' typ) = IsSubList ct ct' 
IsElem e e = () 
IsElem e (NamedRoutes rs) = IsElem e (ToServantApi rs) 
IsElem e a = IsElem' e a 

type family IsElem' a s #

class HasLink (endpoint :: k) where #

Associated Types

type MkLink (endpoint :: k) a #

Methods

toLink :: (Link -> a) -> Proxy endpoint -> Link -> MkLink endpoint a #

Instances

data Link #

Instances

type family MkLink (endpoint :: k) a #

Instances

safeLink :: (IsElem endpoint api, HasLink endpoint) => Proxy api -> Proxy endpoint -> MkLink endpoint Link #

data URI #

Constructors

URI 

Fields

Instances

Instances details
NFData URI 
Instance details

Defined in Network.URI

Methods

rnf :: URI -> ()

Data URI 
Instance details

Defined in Network.URI

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> URI -> c URI

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c URI

toConstr :: URI -> Constr

dataTypeOf :: URI -> DataType

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c URI)

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c URI)

gmapT :: (forall b. Data b => b -> b) -> URI -> URI

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> URI -> r

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> URI -> r

gmapQ :: (forall d. Data d => d -> u) -> URI -> [u]

gmapQi :: Int -> (forall d. Data d => d -> u) -> URI -> u

gmapM :: Monad m => (forall d. Data d => d -> m d) -> URI -> m URI

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> URI -> m URI

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> URI -> m URI

Generic URI 
Instance details

Defined in Network.URI

Associated Types

type Rep URI 
Instance details

Defined in Network.URI

type Rep URI = D1 ('MetaData "URI" "Network.URI" "network-uri-2.6.4.2-GTqI74Lt4lJDBgalj7yv6f" 'False) (C1 ('MetaCons "URI" 'PrefixI 'True) ((S1 ('MetaSel ('Just "uriScheme") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just "uriAuthority") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe URIAuth))) :*: (S1 ('MetaSel ('Just "uriPath") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: (S1 ('MetaSel ('Just "uriQuery") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just "uriFragment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))))

Methods

from :: URI -> Rep URI x

to :: Rep URI x -> URI

Show URI 
Instance details

Defined in Network.URI

Methods

showsPrec :: Int -> URI -> ShowS

show :: URI -> String

showList :: [URI] -> ShowS

Eq URI 
Instance details

Defined in Network.URI

Methods

(==) :: URI -> URI -> Bool

(/=) :: URI -> URI -> Bool

Ord URI 
Instance details

Defined in Network.URI

Methods

compare :: URI -> URI -> Ordering

(<) :: URI -> URI -> Bool

(<=) :: URI -> URI -> Bool

(>) :: URI -> URI -> Bool

(>=) :: URI -> URI -> Bool

max :: URI -> URI -> URI

min :: URI -> URI -> URI

Lift URI 
Instance details

Defined in Network.URI

Methods

lift :: Quote m => URI -> m Exp

liftTyped :: forall (m :: Type -> Type). Quote m => URI -> Code m URI

type Rep URI 
Instance details

Defined in Network.URI

type Rep URI = D1 ('MetaData "URI" "Network.URI" "network-uri-2.6.4.2-GTqI74Lt4lJDBgalj7yv6f" 'False) (C1 ('MetaCons "URI" 'PrefixI 'True) ((S1 ('MetaSel ('Just "uriScheme") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just "uriAuthority") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe URIAuth))) :*: (S1 ('MetaSel ('Just "uriPath") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: (S1 ('MetaSel ('Just "uriQuery") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just "uriFragment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))))

type family AllIsElem (xs :: [Type]) api where ... #

Equations

AllIsElem ('[] :: [Type]) api = () 
AllIsElem (x ': xs) api = (IsElem x api, AllIsElem xs api) 

type family AllIsIn (xs :: [Type]) api where ... #

Equations

AllIsIn ('[] :: [Type]) api = () 
AllIsIn (x ': xs) api = (IsIn x api, AllIsIn xs api) 

type family AppendList (xs :: [a]) (ys :: [a]) :: [a] where ... #

Equations

AppendList ('[] :: [a]) (ys :: [a]) = ys 
AppendList (x ': xs :: [a]) (ys :: [a]) = x ': AppendList xs ys 

type family ElemGo (e :: t) (es :: [t]) (orig :: t1) where ... #

Equations

ElemGo (x :: a) (x ': xs :: [a]) (orig :: t) = () 
ElemGo (y :: t1) (x ': xs :: [t1]) (orig :: t2) = ElemGo y xs orig 
ElemGo (x :: t1) ('[] :: [t1]) (orig :: t2) = TypeError (('ShowType x ':<>: 'Text " expected in list ") ':<>: 'ShowType orig) :: Constraint 

type family Endpoints api :: [Type] where ... #

Equations

Endpoints (a :<|> b) = AppendList (Endpoints a) (Endpoints b) 
Endpoints (e :> a) = MapSub e (Endpoints a) 
Endpoints a = '[a] 

type family IsIn endpoint api where ... #

Equations

IsIn e (sa :<|> sb) = Or (IsIn e sa) (IsIn e sb) 
IsIn (e :> sa) (e :> sb) = IsIn sa sb 
IsIn e e = () 
IsIn e (NamedRoutes record) = IsIn e (ToServantApi record) 

type family IsStrictSubAPI sub api where ... #

Equations

IsStrictSubAPI sub api = AllIsIn (Endpoints sub) api 

type family IsSubAPI sub api where ... #

Equations

IsSubAPI sub api = AllIsElem (Endpoints sub) api 

type family IsSubList (a :: [t]) (b :: [t]) where ... #

Equations

IsSubList ('[] :: [t]) (b :: [t]) = () 
IsSubList (x ': xs :: [t]) (y :: [t]) = And (Elem x y) (IsSubList xs y) 

type family MapSub (e :: k) (xs :: [Type]) :: [Type] where ... #

Equations

MapSub (e :: k) ('[] :: [Type]) = '[] :: [Type] 
MapSub (e :: k) (x ': xs) = (e :> x) ': MapSub e xs 

type family Or a b where ... #

Equations

Or () b = () 
Or a () = () 

data LinkArrayElementStyle #

Instances

Instances details
Bounded LinkArrayElementStyle 
Instance details

Defined in Servant.Links

Enum LinkArrayElementStyle 
Instance details

Defined in Servant.Links

Show LinkArrayElementStyle 
Instance details

Defined in Servant.Links

Methods

showsPrec :: Int -> LinkArrayElementStyle -> ShowS

show :: LinkArrayElementStyle -> String

showList :: [LinkArrayElementStyle] -> ShowS

Eq LinkArrayElementStyle 
Instance details

Defined in Servant.Links

Ord LinkArrayElementStyle 
Instance details

Defined in Servant.Links

data AsLink a #

Instances

data Param #

Constructors

SingleParam String Text 
ArrayElemParam String Text 
FlagParam String 

Instances

Instances details
Show Param 
Instance details

Defined in Servant.Links

Methods

showsPrec :: Int -> Param -> ShowS

show :: Param -> String

showList :: [Param] -> ShowS

allFieldLinks' :: (HasLink (ToServantApi routes), GenericServant routes (AsLink a), ToServant routes (AsLink a) ~ MkLink (ToServantApi routes) a) => (Link -> a) -> routes (AsLink a) #

allLinks :: forall {k} (api :: k). HasLink api => Proxy api -> MkLink api Link #

allLinks' :: forall {k} (api :: k) a. HasLink api => (Link -> a) -> Proxy api -> MkLink api a #

fieldLink :: (IsElem endpoint (ToServantApi routes), HasLink endpoint, GenericServant routes AsApi) => (routes AsApi -> endpoint) -> MkLink endpoint Link #

fieldLink' :: forall routes endpoint a. (IsElem endpoint (ToServantApi routes), HasLink endpoint, GenericServant routes AsApi) => (Link -> a) -> (routes AsApi -> endpoint) -> MkLink endpoint a #

linkFragment :: Link -> Fragment' #

linkSegments :: Link -> [String] #

safeLink' :: (IsElem endpoint api, HasLink endpoint) => (Link -> a) -> Proxy api -> Proxy endpoint -> MkLink endpoint a #

Useful re-exports

data Proxy (t :: k) #

Constructors

Proxy 

Instances

Instances details
Generic1 (Proxy :: k -> Type) 
Instance details

Defined in GHC.Internal.Generics

Associated Types

type Rep1 (Proxy :: k -> Type) 
Instance details

Defined in GHC.Internal.Generics

type Rep1 (Proxy :: k -> Type) = D1 ('MetaData "Proxy" "GHC.Internal.Data.Proxy" "ghc-internal" 'False) (C1 ('MetaCons "Proxy" 'PrefixI 'False) (U1 :: k -> Type))

Methods

from1 :: forall (a :: k). Proxy a -> Rep1 (Proxy :: k -> Type) a

to1 :: forall (a :: k). Rep1 (Proxy :: k -> Type) a -> Proxy a

MonadZip (Proxy :: Type -> Type) 
Instance details

Defined in Control.Monad.Zip

Methods

mzip :: Proxy a -> Proxy b -> Proxy (a, b)

mzipWith :: (a -> b -> c) -> Proxy a -> Proxy b -> Proxy c

munzip :: Proxy (a, b) -> (Proxy a, Proxy b)

Eq1 (Proxy :: Type -> Type) 
Instance details

Defined in Data.Functor.Classes

Methods

liftEq :: (a -> b -> Bool) -> Proxy a -> Proxy b -> Bool

Ord1 (Proxy :: Type -> Type) 
Instance details

Defined in Data.Functor.Classes

Methods

liftCompare :: (a -> b -> Ordering) -> Proxy a -> Proxy b -> Ordering

Read1 (Proxy :: Type -> Type) 
Instance details

Defined in Data.Functor.Classes

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Proxy a)

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Proxy a]

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Proxy a)

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Proxy a]

Show1 (Proxy :: Type -> Type) 
Instance details

Defined in Data.Functor.Classes

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Proxy a -> ShowS

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Proxy a] -> ShowS

Contravariant (Proxy :: Type -> Type) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a) -> Proxy a -> Proxy a'

(>$) :: b -> Proxy b -> Proxy a

NFData1 (Proxy :: Type -> Type) 
Instance details

Defined in Control.DeepSeq

Methods

liftRnf :: (a -> ()) -> Proxy a -> ()

Alternative (Proxy :: Type -> Type) 
Instance details

Defined in GHC.Internal.Data.Proxy

Methods

empty :: Proxy a

(<|>) :: Proxy a -> Proxy a -> Proxy a

some :: Proxy a -> Proxy [a]

many :: Proxy a -> Proxy [a]

Applicative (Proxy :: Type -> Type) 
Instance details

Defined in GHC.Internal.Data.Proxy

Methods

pure :: a -> Proxy a

(<*>) :: Proxy (a -> b) -> Proxy a -> Proxy b

liftA2 :: (a -> b -> c) -> Proxy a -> Proxy b -> Proxy c

(*>) :: Proxy a -> Proxy b -> Proxy b

(<*) :: Proxy a -> Proxy b -> Proxy a

Functor (Proxy :: Type -> Type) 
Instance details

Defined in GHC.Internal.Data.Proxy

Methods

fmap :: (a -> b) -> Proxy a -> Proxy b

(<$) :: a -> Proxy b -> Proxy a

Monad (Proxy :: Type -> Type) 
Instance details

Defined in GHC.Internal.Data.Proxy

Methods

(>>=) :: Proxy a -> (a -> Proxy b) -> Proxy b

(>>) :: Proxy a -> Proxy b -> Proxy b

return :: a -> Proxy a

MonadPlus (Proxy :: Type -> Type) 
Instance details

Defined in GHC.Internal.Data.Proxy

Methods

mzero :: Proxy a

mplus :: Proxy a -> Proxy a -> Proxy a

Foldable (Proxy :: Type -> Type) 
Instance details

Defined in GHC.Internal.Data.Foldable

Methods

fold :: Monoid m => Proxy m -> m

foldMap :: Monoid m => (a -> m) -> Proxy a -> m

foldMap' :: Monoid m => (a -> m) -> Proxy a -> m

foldr :: (a -> b -> b) -> b -> Proxy a -> b

foldr' :: (a -> b -> b) -> b -> Proxy a -> b

foldl :: (b -> a -> b) -> b -> Proxy a -> b

foldl' :: (b -> a -> b) -> b -> Proxy a -> b

foldr1 :: (a -> a -> a) -> Proxy a -> a

foldl1 :: (a -> a -> a) -> Proxy a -> a

toList :: Proxy a -> [a]

null :: Proxy a -> Bool

length :: Proxy a -> Int

elem :: Eq a => a -> Proxy a -> Bool

maximum :: Ord a => Proxy a -> a

minimum :: Ord a => Proxy a -> a

sum :: Num a => Proxy a -> a

product :: Num a => Proxy a -> a

Traversable (Proxy :: Type -> Type) 
Instance details

Defined in GHC.Internal.Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Proxy a -> f (Proxy b)

sequenceA :: Applicative f => Proxy (f a) -> f (Proxy a)

mapM :: Monad m => (a -> m b) -> Proxy a -> m (Proxy b)

sequence :: Monad m => Proxy (m a) -> m (Proxy a)

Hashable1 (Proxy :: Type -> Type) 
Instance details

Defined in Data.Hashable.Class

Methods

liftHashWithSalt :: (Int -> a -> Int) -> Int -> Proxy a -> Int

NFData (Proxy a) 
Instance details

Defined in Control.DeepSeq

Methods

rnf :: Proxy a -> ()

Monoid (Proxy s) 
Instance details

Defined in GHC.Internal.Data.Proxy

Methods

mempty :: Proxy s

mappend :: Proxy s -> Proxy s -> Proxy s

mconcat :: [Proxy s] -> Proxy s

Semigroup (Proxy s) 
Instance details

Defined in GHC.Internal.Data.Proxy

Methods

(<>) :: Proxy s -> Proxy s -> Proxy s

sconcat :: NonEmpty (Proxy s) -> Proxy s

stimes :: Integral b => b -> Proxy s -> Proxy s

Bounded (Proxy t) 
Instance details

Defined in GHC.Internal.Data.Proxy

Methods

minBound :: Proxy t

maxBound :: Proxy t

Enum (Proxy s) 
Instance details

Defined in GHC.Internal.Data.Proxy

Methods

succ :: Proxy s -> Proxy s

pred :: Proxy s -> Proxy s

toEnum :: Int -> Proxy s

fromEnum :: Proxy s -> Int

enumFrom :: Proxy s -> [Proxy s]

enumFromThen :: Proxy s -> Proxy s -> [Proxy s]

enumFromTo :: Proxy s -> Proxy s -> [Proxy s]

enumFromThenTo :: Proxy s -> Proxy s -> Proxy s -> [Proxy s]

Generic (Proxy t) 
Instance details

Defined in GHC.Internal.Generics

Associated Types

type Rep (Proxy t) 
Instance details

Defined in GHC.Internal.Generics

type Rep (Proxy t) = D1 ('MetaData "Proxy" "GHC.Internal.Data.Proxy" "ghc-internal" 'False) (C1 ('MetaCons "Proxy" 'PrefixI 'False) (U1 :: Type -> Type))

Methods

from :: Proxy t -> Rep (Proxy t) x

to :: Rep (Proxy t) x -> Proxy t

Ix (Proxy s) 
Instance details

Defined in GHC.Internal.Data.Proxy

Methods

range :: (Proxy s, Proxy s) -> [Proxy s]

index :: (Proxy s, Proxy s) -> Proxy s -> Int

unsafeIndex :: (Proxy s, Proxy s) -> Proxy s -> Int

inRange :: (Proxy s, Proxy s) -> Proxy s -> Bool

rangeSize :: (Proxy s, Proxy s) -> Int

unsafeRangeSize :: (Proxy s, Proxy s) -> Int

Read (Proxy t) 
Instance details

Defined in GHC.Internal.Data.Proxy

Methods

readsPrec :: Int -> ReadS (Proxy t)

readList :: ReadS [Proxy t]

readPrec :: ReadPrec (Proxy t)

readListPrec :: ReadPrec [Proxy t]

Show (Proxy s) 
Instance details

Defined in GHC.Internal.Data.Proxy

Methods

showsPrec :: Int -> Proxy s -> ShowS

show :: Proxy s -> String

showList :: [Proxy s] -> ShowS

Eq (Proxy s) 
Instance details

Defined in GHC.Internal.Data.Proxy

Methods

(==) :: Proxy s -> Proxy s -> Bool

(/=) :: Proxy s -> Proxy s -> Bool

Ord (Proxy s) 
Instance details

Defined in GHC.Internal.Data.Proxy

Methods

compare :: Proxy s -> Proxy s -> Ordering

(<) :: Proxy s -> Proxy s -> Bool

(<=) :: Proxy s -> Proxy s -> Bool

(>) :: Proxy s -> Proxy s -> Bool

(>=) :: Proxy s -> Proxy s -> Bool

max :: Proxy s -> Proxy s -> Proxy s

min :: Proxy s -> Proxy s -> Proxy s

Hashable (Proxy a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Proxy a -> Int

hash :: Proxy a -> Int

type Rep1 (Proxy :: k -> Type) 
Instance details

Defined in GHC.Internal.Generics

type Rep1 (Proxy :: k -> Type) = D1 ('MetaData "Proxy" "GHC.Internal.Data.Proxy" "ghc-internal" 'False) (C1 ('MetaCons "Proxy" 'PrefixI 'False) (U1 :: k -> Type))
type Rep (Proxy t) 
Instance details

Defined in GHC.Internal.Generics

type Rep (Proxy t) = D1 ('MetaData "Proxy" "GHC.Internal.Data.Proxy" "ghc-internal" 'False) (C1 ('MetaCons "Proxy" 'PrefixI 'False) (U1 :: Type -> Type))

throwError :: MonadError e m => e -> m a #