-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | A family of combinators for defining webservices APIs and serving them
--   . You can learn about the basics in the <a>tutorial</a>. .
--   <a>CHANGELOG</a>
@package servant
@version 0.20.3.0

module Servant.API.Alternative

-- | Union of two APIs, first takes precedence in case of overlap.
--   
--   Example:
--   
--   <pre>
--   &gt;&gt;&gt; :{
--   type MyApi = "books" :&gt; Get '[JSON] [Book] -- GET /books
--          :&lt;|&gt; "books" :&gt; ReqBody '[JSON] Book :&gt; Post '[JSON] () -- POST /books
--   :}
--   </pre>
data a :<|> b
(:<|>) :: a -> b -> (:<|>) a b
infixr 3 :<|>
infixr 3 :<|>
instance Data.Biapplicative.Biapplicative (Servant.API.Alternative.:<|>)
instance Data.Bifoldable.Bifoldable (Servant.API.Alternative.:<|>)
instance Data.Bifunctor.Bifunctor (Servant.API.Alternative.:<|>)
instance Data.Bitraversable.Bitraversable (Servant.API.Alternative.:<|>)
instance (GHC.Internal.Enum.Bounded a, GHC.Internal.Enum.Bounded b) => GHC.Internal.Enum.Bounded (a Servant.API.Alternative.:<|> b)
instance (GHC.Classes.Eq a, GHC.Classes.Eq b) => GHC.Classes.Eq (a Servant.API.Alternative.:<|> b)
instance GHC.Internal.Data.Foldable.Foldable ((Servant.API.Alternative.:<|>) a)
instance GHC.Internal.Base.Functor ((Servant.API.Alternative.:<|>) a)
instance (GHC.Internal.Base.Monoid a, GHC.Internal.Base.Monoid b) => GHC.Internal.Base.Monoid (a Servant.API.Alternative.:<|> b)
instance (GHC.Internal.Base.Semigroup a, GHC.Internal.Base.Semigroup b) => GHC.Internal.Base.Semigroup (a Servant.API.Alternative.:<|> b)
instance (GHC.Internal.Show.Show a, GHC.Internal.Show.Show b) => GHC.Internal.Show.Show (a Servant.API.Alternative.:<|> b)
instance GHC.Internal.Data.Traversable.Traversable ((Servant.API.Alternative.:<|>) a)

module Servant.API.BasicAuth

-- | Combinator for <a>Basic Access Authentication</a>.
--   
--   <ul>
--   <li>IMPORTANT*: Only use Basic Auth over HTTPS! Credentials are not
--   hashed or encrypted. Note also that because the same credentials are
--   sent on every request, Basic Auth is not as secure as some
--   alternatives. Further, the implementation in servant-server does not
--   protect against some types of timing attacks.</li>
--   </ul>
--   
--   In Basic Auth, username and password are base64-encoded and
--   transmitted via the <tt>Authorization</tt> header. Handshakes are not
--   required, making it relatively efficient.
data BasicAuth (realm :: Symbol) userData

-- | A simple datatype to hold data required to decorate a request
data BasicAuthData
BasicAuthData :: !ByteString -> !ByteString -> BasicAuthData
[basicAuthUsername] :: BasicAuthData -> !ByteString
[basicAuthPassword] :: BasicAuthData -> !ByteString

module Servant.API.Capture

-- | Capture a value from the request path under a certain type <tt>a</tt>.
--   
--   Example:
--   
--   <pre>
--   &gt;&gt;&gt; -- GET /books/:isbn
--   
--   &gt;&gt;&gt; type MyApi = "books" :&gt; Capture "isbn" Text :&gt; Get '[JSON] Book
--   </pre>
type Capture = Capture' '[] :: [Type]

-- | <a>Capture</a> which can be modified. For example with
--   <tt>Description</tt>.
data Capture' (mods :: [Type]) (sym :: Symbol) a

-- | Capture all remaining values from the request path under a certain
--   type <tt>a</tt>.
--   
--   Example:
--   
--   <pre>
--   &gt;&gt;&gt; -- GET /src/*
--   
--   &gt;&gt;&gt; type MyAPI = "src" :&gt; CaptureAll "segments" Text :&gt; Get '[JSON] SourceFile
--   </pre>
data CaptureAll (sym :: Symbol) a


-- | A collection of basic Content-Types (also known as Internet Media
--   Types, or MIME types). Additionally, this module provides classes that
--   encapsulate how to serialize or deserialize values to or from a
--   particular Content-Type.
--   
--   Content-Types are used in <tt>ReqBody</tt> and the method combinators:
--   
--   <pre>
--   &gt;&gt;&gt; type MyEndpoint = ReqBody '[JSON, PlainText] Book :&gt; Put '[JSON, PlainText] Book
--   </pre>
--   
--   Meaning the endpoint accepts requests of Content-Type
--   <tt>application/json</tt> or <tt>text/plain;charset=utf8</tt>, and
--   returns data in either one of those formats (depending on the
--   <tt>Accept</tt> header).
--   
--   If you would like to support Content-Types beyond those provided here,
--   then:
--   
--   <ol>
--   <li>Declare a new data type with no constructors (e.g. <tt>data
--   HTML</tt>).</li>
--   <li>Make an instance of it for <a>Accept</a>.</li>
--   <li>If you want to be able to serialize data *into* that Content-Type,
--   make an instance of it for <a>MimeRender</a>.</li>
--   <li>If you want to be able to deserialize data *from* that
--   Content-Type, make an instance of it for <a>MimeUnrender</a>.</li>
--   </ol>
--   
--   Note that roles are reversed in <tt>servant-server</tt> and
--   <tt>servant-client</tt>: to be able to serve (or even typecheck) a
--   <tt>Get '[JSON, XML] MyData</tt>, you'll need to have the appropriate
--   <a>MimeRender</a> instances in scope, whereas to query that endpoint
--   with <tt>servant-client</tt>, you'll need a <a>MimeUnrender</a>
--   instance in scope.
module Servant.API.ContentTypes
data JSON
data PlainText
data FormUrlEncoded
data OctetStream
data EventStream

-- | Instances of <a>Accept</a> represent mimetypes. They are used for
--   matching against the <tt>Accept</tt> HTTP header of the request, and
--   for setting the <tt>Content-Type</tt> header of the response
--   
--   Example:
--   
--   <pre>
--   &gt;&gt;&gt; import Network.HTTP.Media ((//), (/:))
--   
--   &gt;&gt;&gt; data HTML
--   
--   &gt;&gt;&gt; :{
--   instance Accept HTML where
--      contentType _ = "text" // "html" /: ("charset", "utf-8")
--   :}
--   </pre>
class Accept (ctype :: k)
contentType :: Accept ctype => Proxy ctype -> MediaType
contentTypes :: Accept ctype => Proxy ctype -> NonEmpty MediaType

-- | Instantiate this class to register a way of serializing a type based
--   on the <tt>Accept</tt> header.
--   
--   Example:
--   
--   <pre>
--   data MyContentType
--   
--   instance Accept MyContentType where
--      contentType _ = "example" // "prs.me.mine" /: ("charset", "utf-8")
--   
--   instance Show a =&gt; MimeRender MyContentType a where
--      mimeRender _ val = pack ("This is MINE! " ++ show val)
--   
--   type MyAPI = "path" :&gt; Get '[MyContentType] Int
--   </pre>
class Accept ctype => MimeRender (ctype :: k) a
mimeRender :: MimeRender ctype a => Proxy ctype -> a -> ByteString

-- | Instantiate this class to register a way of deserializing a type based
--   on the request's <tt>Content-Type</tt> header.
--   
--   <pre>
--   &gt;&gt;&gt; import Network.HTTP.Media hiding (Accept)
--   
--   &gt;&gt;&gt; import qualified Data.ByteString.Lazy.Char8 as BSC
--   
--   &gt;&gt;&gt; data MyContentType = MyContentType String
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; :{
--   instance Accept MyContentType where
--      contentType _ = "example" // "prs.me.mine" /: ("charset", "utf-8")
--   :}
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; :{
--   instance Read a =&gt; MimeUnrender MyContentType a where
--      mimeUnrender _ bs = case BSC.take 12 bs of
--        "MyContentType" -&gt; return . read . BSC.unpack $ BSC.drop 12 bs
--        _ -&gt; Left "didn't start with the magic incantation"
--   :}
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; type MyAPI = "path" :&gt; ReqBody '[MyContentType] Int :&gt; Get '[JSON] Int
--   </pre>
class Accept ctype => MimeUnrender (ctype :: k) a
mimeUnrender :: MimeUnrender ctype a => Proxy ctype -> ByteString -> Either String a

-- | Variant which is given the actual <a>MediaType</a> provided by the
--   other party.
--   
--   In the most cases you don't want to branch based on the
--   <a>MediaType</a>. See <a>pr552</a> for a motivating example.
mimeUnrenderWithType :: MimeUnrender ctype a => Proxy ctype -> MediaType -> ByteString -> Either String a

-- | A type for responses without content-body.
data NoContent
NoContent :: NoContent
newtype AcceptHeader
AcceptHeader :: ByteString -> AcceptHeader
class AllMime list => AllCTRender (list :: [Type]) a
handleAcceptH :: AllCTRender list a => Proxy list -> AcceptHeader -> a -> Maybe (ByteString, ByteString)
class AllCTUnrender (list :: [Type]) a
canHandleCTypeH :: AllCTUnrender list a => Proxy list -> ByteString -> Maybe (ByteString -> Either String a)
handleCTypeH :: AllCTUnrender list a => Proxy list -> ByteString -> ByteString -> Maybe (Either String a)
class AllMime (list :: [Type])
allMime :: AllMime list => Proxy list -> [MediaType]
class AllMime list => AllMimeRender (list :: [Type]) a
allMimeRender :: AllMimeRender list a => Proxy list -> a -> [(MediaType, ByteString)]
class AllMime list => AllMimeUnrender (list :: [Type]) a
allMimeUnrender :: AllMimeUnrender list a => Proxy list -> [(MediaType, ByteString -> Either String a)]

-- | Deprecated: since aeson version 0.9 <a>eitherDecode</a> has lenient
--   behavior.

-- | <i>Deprecated: use eitherDecode instead</i>
eitherDecodeLenient :: FromJSON a => ByteString -> Either String a
canHandleAcceptH :: forall (list :: [Type]). AllMime list => Proxy list -> AcceptHeader -> Bool

-- | Chunk of an event stream
newtype EventStreamChunk
EventStreamChunk :: ByteString -> EventStreamChunk
[unEventStreamChunk] :: EventStreamChunk -> ByteString
instance Servant.API.ContentTypes.Accept Servant.API.ContentTypes.EventStream
instance Servant.API.ContentTypes.Accept Servant.API.ContentTypes.FormUrlEncoded
instance Servant.API.ContentTypes.Accept Servant.API.ContentTypes.JSON
instance Servant.API.ContentTypes.Accept Servant.API.ContentTypes.OctetStream
instance Servant.API.ContentTypes.Accept Servant.API.ContentTypes.PlainText
instance (Servant.API.ContentTypes.Accept ct, Servant.API.ContentTypes.AllMime cts, Servant.API.ContentTypes.AllMimeRender (ct : cts) a) => Servant.API.ContentTypes.AllCTRender (ct : cts) a
instance (TypeError ...) => Servant.API.ContentTypes.AllCTRender '[] ()
instance Servant.API.ContentTypes.AllMimeUnrender ctyps a => Servant.API.ContentTypes.AllCTUnrender ctyps a
instance Servant.API.ContentTypes.Accept ctyp => Servant.API.ContentTypes.AllMimeRender '[ctyp] Servant.API.ContentTypes.NoContent
instance Servant.API.ContentTypes.AllMime (ctyp : ctyp' : ctyps) => Servant.API.ContentTypes.AllMimeRender (ctyp : ctyp' : ctyps) Servant.API.ContentTypes.NoContent
instance Servant.API.ContentTypes.MimeRender ctyp a => Servant.API.ContentTypes.AllMimeRender '[ctyp] a
instance (Servant.API.ContentTypes.MimeRender ctyp a, Servant.API.ContentTypes.AllMimeRender (ctyp' : ctyps) a) => Servant.API.ContentTypes.AllMimeRender (ctyp : ctyp' : ctyps) a
instance (Servant.API.ContentTypes.MimeUnrender ctyp a, Servant.API.ContentTypes.AllMimeUnrender ctyps a) => Servant.API.ContentTypes.AllMimeUnrender (ctyp : ctyps) a
instance Servant.API.ContentTypes.AllMimeUnrender '[] a
instance (Servant.API.ContentTypes.Accept ctyp, Servant.API.ContentTypes.AllMime ctyps) => Servant.API.ContentTypes.AllMime (ctyp : ctyps)
instance Servant.API.ContentTypes.AllMime '[]
instance GHC.Classes.Eq Servant.API.ContentTypes.AcceptHeader
instance GHC.Classes.Eq Servant.API.ContentTypes.NoContent
instance GHC.Internal.Generics.Generic Servant.API.ContentTypes.AcceptHeader
instance GHC.Internal.Generics.Generic Servant.API.ContentTypes.NoContent
instance Web.Internal.FormUrlEncoded.ToForm a => Servant.API.ContentTypes.MimeRender Servant.API.ContentTypes.FormUrlEncoded a
instance Data.Aeson.Types.ToJSON.ToJSON a => Servant.API.ContentTypes.MimeRender Servant.API.ContentTypes.JSON a
instance Servant.API.ContentTypes.MimeRender Servant.API.ContentTypes.OctetStream Data.ByteString.Internal.Type.ByteString
instance Servant.API.ContentTypes.MimeRender Servant.API.ContentTypes.OctetStream Data.ByteString.Lazy.Internal.ByteString
instance Servant.API.ContentTypes.MimeRender Servant.API.ContentTypes.PlainText GHC.Internal.Base.String
instance Servant.API.ContentTypes.MimeRender Servant.API.ContentTypes.PlainText Data.Text.Internal.Text
instance Servant.API.ContentTypes.MimeRender Servant.API.ContentTypes.PlainText Data.Text.Internal.Lazy.Text
instance Servant.API.ContentTypes.MimeUnrender Servant.API.ContentTypes.EventStream Servant.API.ContentTypes.EventStreamChunk
instance Web.Internal.FormUrlEncoded.FromForm a => Servant.API.ContentTypes.MimeUnrender Servant.API.ContentTypes.FormUrlEncoded a
instance Data.Aeson.Types.FromJSON.FromJSON a => Servant.API.ContentTypes.MimeUnrender Servant.API.ContentTypes.JSON a
instance Servant.API.ContentTypes.MimeUnrender Servant.API.ContentTypes.OctetStream Data.ByteString.Internal.Type.ByteString
instance Servant.API.ContentTypes.MimeUnrender Servant.API.ContentTypes.OctetStream Data.ByteString.Lazy.Internal.ByteString
instance Servant.API.ContentTypes.MimeUnrender Servant.API.ContentTypes.PlainText GHC.Internal.Base.String
instance Servant.API.ContentTypes.MimeUnrender Servant.API.ContentTypes.PlainText Data.Text.Internal.Text
instance Servant.API.ContentTypes.MimeUnrender Servant.API.ContentTypes.PlainText Data.Text.Internal.Lazy.Text
instance Control.DeepSeq.NFData Servant.API.ContentTypes.NoContent
instance GHC.Internal.Read.Read Servant.API.ContentTypes.AcceptHeader
instance GHC.Internal.Read.Read Servant.API.ContentTypes.NoContent
instance GHC.Internal.Show.Show Servant.API.ContentTypes.AcceptHeader
instance GHC.Internal.Show.Show Servant.API.ContentTypes.NoContent

module Servant.API.Description

-- | Add more verbose description for (part of) API.
--   
--   Example:
--   
--   <pre>
--   &gt;&gt;&gt; :{
--   type MyApi = Description
--    "This comment is visible in multiple Servant interpretations \
--    \and can be really long if necessary. \
--    \Haskell multiline String support is not perfect \
--    \but it's still very readable."
--   :&gt; Get '[JSON] Book
--   :}
--   </pre>
data Description (sym :: Symbol)

-- | Add a short summary for (part of) API.
--   
--   Example:
--   
--   <pre>
--   &gt;&gt;&gt; type MyApi = Summary "Get book by ISBN." :&gt; "books" :&gt; Capture "isbn" Text :&gt; Get '[JSON] Book
--   </pre>
data Summary (sym :: Symbol)

-- | Fold list of modifiers to extract description as a type-level String.
--   
--   <pre>
--   &gt;&gt;&gt; :kind! FoldDescription '[]
--   FoldDescription '[] :: Symbol
--   = ""
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; :kind! FoldDescription '[Required, Description "foobar", Lenient]
--   FoldDescription '[Required, Description "foobar", Lenient] :: Symbol
--   = "foobar"
--   </pre>
type FoldDescription (mods :: [Type]) = FoldDescription' "" mods

-- | Implementation of <a>FoldDescription</a>.
type family FoldDescription' (acc :: Symbol) (mods :: [Type]) :: Symbol

-- | Reflect description to the term level.
--   
--   <pre>
--   &gt;&gt;&gt; reflectDescription (Proxy :: Proxy '[Required, Description "foobar", Lenient])
--   "foobar"
--   </pre>
reflectDescription :: forall (mods :: [Type]). KnownSymbol (FoldDescription mods) => Proxy mods -> String

module Servant.API.Empty

-- | An empty API: one which serves nothing. Morally speaking, this should
--   be the unit of <tt>:&lt;|&gt;</tt>. Implementors of interpretations of
--   API types should treat <a>EmptyAPI</a> as close to the unit as
--   possible.
data EmptyAPI
EmptyAPI :: EmptyAPI
instance GHC.Internal.Enum.Bounded Servant.API.Empty.EmptyAPI
instance GHC.Internal.Enum.Enum Servant.API.Empty.EmptyAPI
instance GHC.Classes.Eq Servant.API.Empty.EmptyAPI
instance GHC.Internal.Show.Show Servant.API.Empty.EmptyAPI

module Servant.API.Experimental.Auth

-- | A generalized Authentication combinator. Use this if you have a
--   non-standard authentication technique.
--   
--   NOTE: THIS API IS EXPERIMENTAL AND SUBJECT TO CHANGE.
data AuthProtect (tag :: k)

module Servant.API.Fragment

-- | Document the URI fragment in API. Useful in combination with
--   <tt>Link</tt>.
--   
--   Example:
--   
--   <pre>
--   &gt;&gt;&gt; -- /post#TRACKING
--   
--   &gt;&gt;&gt; type MyApi = "post" :&gt; Fragment Text :&gt; Get '[JSON] Tracking
--   </pre>
data Fragment a


-- | Define servant servers from record types. Generics for the win.
--   
--   The usage is simple, if you only need a collection of routes. First
--   you define a record with field types prefixed by a parameter
--   <tt>route</tt>:
--   
--   <pre>
--   data Routes route = Routes
--       { _get :: route :- Capture "id" Int :&gt; Get '[JSON] String
--       , _put :: route :- ReqBody '[JSON] Int :&gt; Put '[JSON] Bool
--       }
--     deriving (<a>Generic</a>)
--   </pre>
--   
--   You can get a <a>Proxy</a> of the server using
--   
--   <pre>
--   api :: Proxy (ToServantApi Routes)
--   api = genericApi (Proxy :: Proxy Routes)
--   </pre>
--   
--   Using <a>genericApi</a> is better as it checks that instances exists,
--   i.e. you get better error messages than simply using <a>Proxy</a>
--   value.
--   
--   <b>Note:</b> in 0.14 series this module isn't re-exported from
--   <a>API</a>.
--   
--   <a>Servant.API.Generic</a> is based on <tt>servant-generic</tt>
--   package by <a>Patrick Chilton</a>
module Servant.API.Generic

-- | A class with a type family that applies an appropriate type family to
--   the <tt>api</tt> parameter. For example, <a>AsApi</a> will leave
--   <tt>api</tt> untouched, while <tt><tt>AsServerT</tt> m</tt> will
--   produce <tt><tt>ServerT</tt> api m</tt>.
class GenericMode (mode :: k) where {
    type (mode :: k) :- api;
}
infixl 0 :-

-- | A constraint alias, for work with <tt>mode</tt> and <tt>routes</tt>.
type GenericServant (routes :: k -> Type) (mode :: k) = (GenericMode mode, Generic routes mode, GServantProduct Rep routes mode)

-- | Turns a generic product type into a tree of <a>:&lt;|&gt;</a>
--   combinators.
type ToServant (routes :: k -> Type) (mode :: k) = GToServant Rep routes mode

-- | See <a>ToServant</a>, but at value-level.
toServant :: forall {k} routes (mode :: k). GenericServant routes mode => routes mode -> ToServant routes mode

-- | Inverse of <a>toServant</a>.
--   
--   This can be used to turn <tt>generated</tt> values such as client
--   functions into records.
--   
--   You may need to provide a type signature for the <i>output</i> type
--   (your record type).
fromServant :: forall {k} routes (mode :: k). GenericServant routes mode => ToServant routes mode -> routes mode

-- | A type that specifies that an API record contains an API definition.
--   Only useful at type-level.
data AsApi
type ToServantApi (routes :: Type -> Type) = ToServant routes AsApi

-- | Get a <a>Proxy</a> of an API type.
genericApi :: forall (routes :: Type -> Type). GenericServant routes AsApi => Proxy routes -> Proxy (ToServantApi routes)
class GServantProduct (f :: k -> Type)
class Generic a where {
    type Rep a :: Type -> Type;
}
instance forall k (l :: k -> GHC.Types.Type) (r :: k -> GHC.Types.Type). (Servant.API.Generic.GServantProduct l, Servant.API.Generic.GServantProduct r) => Servant.API.Generic.GServantProduct (l GHC.Internal.Generics.:*: r)
instance Servant.API.Generic.GServantProduct (GHC.Internal.Generics.K1 i c)
instance forall k (f :: k -> GHC.Types.Type) i (c :: GHC.Internal.Generics.Meta). Servant.API.Generic.GServantProduct f => Servant.API.Generic.GServantProduct (GHC.Internal.Generics.M1 i c f)
instance Servant.API.Generic.GenericMode Servant.API.Generic.AsApi

module Servant.API.Host

-- | Match against the given host.
--   
--   This allows you to define APIs over multiple domains. For example:
--   
--   <pre>
--   type API = Host "api1.example" :&gt; API1
--         :&lt;|&gt; Host "api2.example" :&gt; API2
--   </pre>
data Host (sym :: Symbol)

module Servant.API.HttpVersion
data HttpVersion
HttpVersion :: !Int -> !Int -> HttpVersion
[httpMajor] :: HttpVersion -> !Int
[httpMinor] :: HttpVersion -> !Int

module Servant.API.IsSecure

-- | Was this request made over an SSL connection?
--   
--   Note that this value will not tell you if the client originally made
--   this request over SSL, but rather whether the current connection is
--   SSL. The distinction lies with reverse proxies. In many cases, the
--   client will connect to a load balancer over SSL, but connect to the
--   WAI handler without SSL. In such a case, the handlers would get
--   <a>NotSecure</a>, but from a user perspective, there is a secure
--   connection.
data IsSecure

-- | the connection to the server is secure (HTTPS)
Secure :: IsSecure

-- | the connection to the server is not secure (HTTP)
NotSecure :: IsSecure
instance GHC.Classes.Eq Servant.API.IsSecure.IsSecure
instance GHC.Internal.Generics.Generic Servant.API.IsSecure.IsSecure
instance GHC.Classes.Ord Servant.API.IsSecure.IsSecure
instance GHC.Internal.Read.Read Servant.API.IsSecure.IsSecure
instance GHC.Internal.Show.Show Servant.API.IsSecure.IsSecure

module Servant.API.Modifiers

-- | Required argument. Not wrapped.
data Required

-- | Optional argument. Wrapped in <a>Maybe</a>.
data Optional

-- | Fold modifier list to decide whether argument is required.
--   
--   <pre>
--   &gt;&gt;&gt; :kind! FoldRequired '[Required, Description "something"]
--   FoldRequired '[Required, Description "something"] :: Bool
--   = 'True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; :kind! FoldRequired '[Required, Optional]
--   FoldRequired '[Required, Optional] :: Bool
--   = 'False
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; :kind! FoldRequired '[]
--   FoldRequired '[] :: Bool
--   = 'False
--   </pre>
type FoldRequired (mods :: [Type]) = FoldRequired' 'False mods

-- | Implementation of <a>FoldRequired</a>.
type family FoldRequired' (acc :: Bool) (mods :: [Type]) :: Bool

-- | Leniently parsed argument, i.e. parsing never fail. Wrapped in
--   <tt><a>Either</a> <a>Text</a></tt>.
data Lenient

-- | Strictly parsed argument. Not wrapped.
data Strict

-- | Fold modifier list to decide whether argument should be parsed
--   strictly or leniently.
--   
--   <pre>
--   &gt;&gt;&gt; :kind! FoldLenient '[]
--   FoldLenient '[] :: Bool
--   = 'False
--   </pre>
type FoldLenient (mods :: [Type]) = FoldLenient' 'False mods

-- | Implementation of <a>FoldLenient</a>.
type family FoldLenient' (acc :: Bool) (mods :: [Type]) :: Bool

-- | Helper type alias.
--   
--   <ul>
--   <li><a>Required</a> ↦ <tt>a</tt></li>
--   <li><a>Optional</a> ↦ <tt><a>Maybe</a> a</tt></li>
--   </ul>
type RequiredArgument (mods :: [Type]) a = If FoldRequired mods a Maybe a

-- | Fold a <tt>RequiredAgument</tt> into a value
foldRequiredArgument :: forall (mods :: [Type]) a r. SBoolI (FoldRequired mods) => Proxy mods -> (a -> r) -> (Maybe a -> r) -> RequiredArgument mods a -> r

-- | Unfold a value into a <a>RequiredArgument</a>.
unfoldRequiredArgument :: forall (mods :: [Type]) m a. (Monad m, SBoolI (FoldRequired mods), SBoolI (FoldLenient mods)) => Proxy mods -> m (RequiredArgument mods a) -> (Text -> m (RequiredArgument mods a)) -> Maybe (Either Text a) -> m (RequiredArgument mods a)

-- | Helper type alias.
--   
--   By default argument is <a>Optional</a> and <a>Strict</a>.
--   
--   <ul>
--   <li><a>Required</a>, <a>Strict</a> ↦ <tt>a</tt></li>
--   <li><a>Required</a>, <a>Lenient</a> ↦ <tt><a>Either</a> <a>Text</a>
--   a</tt></li>
--   <li><a>Optional</a>, <a>Strict</a> ↦ <tt><a>Maybe</a> a</tt></li>
--   <li><a>Optional</a>, <a>Lenient</a> ↦ <tt><a>Maybe</a> (<a>Either</a>
--   <a>Text</a> a)</tt></li>
--   </ul>
type RequestArgument (mods :: [Type]) a = If FoldRequired mods If FoldLenient mods Either Text a a Maybe If FoldLenient mods Either Text a a

-- | Unfold a value into a <a>RequestArgument</a>.
unfoldRequestArgument :: forall (mods :: [Type]) m a. (Monad m, SBoolI (FoldRequired mods), SBoolI (FoldLenient mods)) => Proxy mods -> m (RequestArgument mods a) -> (Text -> m (RequestArgument mods a)) -> Maybe (Either Text a) -> m (RequestArgument mods a)

module Servant.API.Header

-- | Extract the given header's value as a value of type <tt>a</tt>. I.e.
--   header sent by client, parsed by server.
--   
--   Example:
--   
--   <pre>
--   &gt;&gt;&gt; newtype Referer = Referer Text deriving (Eq, Show)
--   
--   &gt;&gt;&gt; 
--   
--   &gt;&gt;&gt; -- GET /view-my-referer
--   
--   &gt;&gt;&gt; type MyApi = "view-my-referer" :&gt; Header "from" Referer :&gt; Get '[JSON] Referer
--   </pre>
type Header = Header' '[Optional, Strict]
data Header' (mods :: [Type]) (sym :: Symbol) a

module Servant.API.NamedRoutes

-- | Combinator for embedding a record of named routes into a Servant API
--   type.
data NamedRoutes (api :: Type -> Type)

module Servant.API.QueryParam

-- | Lookup a potentially value-less query string parameter with boolean
--   semantics. If the param <tt>sym</tt> is there without any value, or if
--   it's there with value "true" or "1", it's interpreted as <a>True</a>.
--   Otherwise, it's interpreted as <a>False</a>.
--   
--   Example:
--   
--   <pre>
--   &gt;&gt;&gt; -- /books?published
--   
--   &gt;&gt;&gt; type MyApi = "books" :&gt; QueryFlag "published" :&gt; Get '[JSON] [Book]
--   </pre>
data QueryFlag (sym :: Symbol)

-- | Lookup the value associated to the <tt>sym</tt> query string parameter
--   and try to extract it as a value of type <tt>a</tt>.
--   
--   Example:
--   
--   <pre>
--   &gt;&gt;&gt; -- /books?author=&lt;author name&gt;
--   
--   &gt;&gt;&gt; type MyApi = "books" :&gt; QueryParam "author" Text :&gt; Get '[JSON] [Book]
--   </pre>
type QueryParam = QueryParam' '[Optional, Strict]

-- | <a>QueryParam</a> which can be <a>Required</a>, <a>Lenient</a>, or
--   modified otherwise.
data QueryParam' (mods :: [Type]) (sym :: Symbol) a

-- | Lookup the values associated to the <tt>sym</tt> query string
--   parameter and try to extract it as a value of type <tt>[a]</tt>. This
--   is typically meant to support query string parameters of the form
--   <tt>param[]=val1&amp;param[]=val2</tt> and so on. Note that servant
--   doesn't actually require the <tt>[]</tt>s and will fetch the values
--   just fine with <tt>param=val1&amp;param=val2</tt>, too.
--   
--   Example:
--   
--   <pre>
--   &gt;&gt;&gt; -- /books?authors[]=&lt;author1&gt;&amp;authors[]=&lt;author2&gt;&amp;...
--   
--   &gt;&gt;&gt; type MyApi = "books" :&gt; QueryParams "authors" Text :&gt; Get '[JSON] [Book]
--   </pre>
data QueryParams (sym :: Symbol) a

module Servant.API.QueryString

-- | Extract the whole query string from a request. This is useful for
--   query strings containing dynamic parameter names. For query strings
--   with static parameter names, <tt>QueryParam</tt> is more suited.
--   
--   Example:
--   
--   <pre>
--   &gt;&gt;&gt; -- /books?author=&lt;author name&gt;&amp;year=&lt;book year&gt;
--   
--   &gt;&gt;&gt; type MyApi = "books" :&gt; QueryString :&gt; Get '[JSON] [Book]
--   </pre>
data QueryString

-- | Extract an deep object from a query string.
--   
--   Example:
--   
--   <pre>
--   &gt;&gt;&gt; -- /books?filter[author][name]=&lt;author name&gt;&amp;filter[year]=&lt;book year&gt;
--   
--   &gt;&gt;&gt; type MyApi = "books" :&gt; DeepQuery "filter" BookQuery :&gt; Get '[JSON] [Book]
--   </pre>
data DeepQuery (sym :: Symbol) a

-- | Extract a deep object from (possibly nested) query parameters. a param
--   like <tt>filter[a][b][c]=d</tt> will be represented as <tt>'(["a",
--   "b", "c"], Just "d")'</tt>. Note that a parameter with no nested field
--   is possible: <tt>filter=a</tt> will be represented as <tt>'([], Just
--   "a")'</tt>
class FromDeepQuery a
fromDeepQuery :: FromDeepQuery a => [([Text], Maybe Text)] -> Either String a

-- | Generate query parameters from an object, using the deep object
--   syntax. A result of <tt>'(["a", "b", "c"], Just "d")'</tt> attributed
--   to the <tt>filter</tt> parameter name will result in the following
--   query parameter: <tt>filter[a][b][c]=d</tt>
class ToDeepQuery a
toDeepQuery :: ToDeepQuery a => a -> [([Text], Maybe Text)]

-- | Turn a nested path into a deep object query param
--   
--   <pre>
--   &gt;&gt;&gt; generateDeepParam "filter" (["a", "b", "c"], Just "d")
--   ("filter[a][b][c]",Just "d")
--   </pre>
generateDeepParam :: Text -> ([Text], Maybe Text) -> (Text, Maybe Text)
instance Web.Internal.HttpApiData.FromHttpApiData a => Servant.API.QueryString.FromDeepQuery (Data.Map.Internal.Map Data.Text.Internal.Text a)

module Servant.API.Raw

-- | Endpoint for plugging in your own Wai <tt>Application</tt>s.
--   
--   The given <tt>Application</tt> will get the request as received by the
--   server, potentially with a modified (stripped) <tt>pathInfo</tt> if
--   the <tt>Application</tt> is being routed with <a>:&gt;</a>.
--   
--   In addition to just letting you plug in your existing WAI
--   <tt>Application</tt>s, this can also be used with functions from
--   <a>Servant.Server.StaticFiles</a> to serve static files stored in a
--   particular directory on your filesystem
data Raw

-- | Variant of <a>Raw</a> that lets you access the underlying monadic
--   context to process the request.
data RawM

module Servant.API.RemoteHost

-- | Provides access to the host or IP address from which the HTTP request
--   was sent.
data RemoteHost

module Servant.API.ReqBody

-- | Extract the request body as a value of type <tt>a</tt>.
--   
--   Example:
--   
--   <pre>
--   &gt;&gt;&gt; -- POST /books
--   
--   &gt;&gt;&gt; type MyApi = "books" :&gt; ReqBody '[JSON] Book :&gt; Post '[JSON] Book
--   </pre>
type ReqBody = ReqBody' '[Required, Strict]

-- | <i>Note:</i> <a>ReqBody'</a> is always <a>Required</a>.
data ReqBody' (mods :: [Type]) (contentTypes :: [Type]) a


-- | Server-sent events
--   
--   See <a>https://www.w3.org/TR/2009/WD-eventsource-20090421/</a>.
module Servant.API.ServerSentEvents

-- | Server-sent events (SSE)
--   
--   See <a>https://www.w3.org/TR/2009/WD-eventsource-20090421/</a>.
data ServerSentEvents' (method :: k) (status :: Nat) (kind :: EventKind) a
type ServerSentEvents = ServerSentEvents' 'GET 200

-- | Determines the shape of events you may receive (i.e. the <tt>a</tt> in
--   'ServerSentEvents'')
data EventKind

-- | <tt>EventMessage</tt> or <tt>Event</tt> <tt>ByteString</tt>
RawEvent :: EventKind

-- | Anything that implements <tt>FromJSON</tt>
JsonEvent :: EventKind
instance forall k (method :: k) (status :: GHC.Internal.TypeNats.Nat) (kind :: Servant.API.ServerSentEvents.EventKind) a. GHC.Internal.Generics.Generic (Servant.API.ServerSentEvents.ServerSentEvents' method status kind a)

module Servant.API.Status

-- | Retrieve a known or unknown Status from a KnownNat
statusFromNat :: forall (a :: Nat) proxy. KnownNat a => proxy a -> Status

-- | Witness that a type-level natural number corresponds to a HTTP status
--   code
class KnownNat n => KnownStatus (n :: Nat)
statusVal :: KnownStatus n => proxy n -> Status
instance Servant.API.Status.KnownStatus 511
instance Servant.API.Status.KnownStatus 505
instance Servant.API.Status.KnownStatus 504
instance Servant.API.Status.KnownStatus 503
instance Servant.API.Status.KnownStatus 502
instance Servant.API.Status.KnownStatus 501
instance Servant.API.Status.KnownStatus 500
instance Servant.API.Status.KnownStatus 431
instance Servant.API.Status.KnownStatus 429
instance Servant.API.Status.KnownStatus 428
instance Servant.API.Status.KnownStatus 426
instance Servant.API.Status.KnownStatus 422
instance Servant.API.Status.KnownStatus 418
instance Servant.API.Status.KnownStatus 417
instance Servant.API.Status.KnownStatus 416
instance Servant.API.Status.KnownStatus 415
instance Servant.API.Status.KnownStatus 414
instance Servant.API.Status.KnownStatus 413
instance Servant.API.Status.KnownStatus 412
instance Servant.API.Status.KnownStatus 411
instance Servant.API.Status.KnownStatus 410
instance Servant.API.Status.KnownStatus 409
instance Servant.API.Status.KnownStatus 408
instance Servant.API.Status.KnownStatus 407
instance Servant.API.Status.KnownStatus 406
instance Servant.API.Status.KnownStatus 405
instance Servant.API.Status.KnownStatus 404
instance Servant.API.Status.KnownStatus 403
instance Servant.API.Status.KnownStatus 402
instance Servant.API.Status.KnownStatus 401
instance Servant.API.Status.KnownStatus 400
instance Servant.API.Status.KnownStatus 308
instance Servant.API.Status.KnownStatus 307
instance Servant.API.Status.KnownStatus 305
instance Servant.API.Status.KnownStatus 304
instance Servant.API.Status.KnownStatus 303
instance Servant.API.Status.KnownStatus 302
instance Servant.API.Status.KnownStatus 301
instance Servant.API.Status.KnownStatus 300
instance Servant.API.Status.KnownStatus 206
instance Servant.API.Status.KnownStatus 205
instance Servant.API.Status.KnownStatus 204
instance Servant.API.Status.KnownStatus 203
instance Servant.API.Status.KnownStatus 202
instance Servant.API.Status.KnownStatus 201
instance Servant.API.Status.KnownStatus 200
instance Servant.API.Status.KnownStatus 101
instance Servant.API.Status.KnownStatus 100

module Servant.API.Sub

-- | The contained API (second argument) can be found under <tt>("/" ++
--   path)</tt> (path being the first argument).
--   
--   Example:
--   
--   <pre>
--   &gt;&gt;&gt; -- GET /hello/world
--   
--   &gt;&gt;&gt; -- returning a JSON encoded World value
--   
--   &gt;&gt;&gt; type MyApi = "hello" :&gt; "world" :&gt; Get '[JSON] World
--   </pre>
data (path :: k) :> a
infixr 4 :>


-- | This module defines the error messages used in type-level errors.
--   Type-level errors can signal non-existing instances, for instance when
--   a combinator is not applied to the correct number of arguments.
module Servant.API.TypeErrors

-- | No instance exists for <tt>tycls (expr :&gt; ...)</tt> because
--   <tt>expr</tt> is not fully saturated.
type PartialApplication (tycls :: k) (expr :: k') = NoInstanceForSub tycls expr ':$$: 'ShowType expr ':<>: 'Text " expects " ':<>: 'ShowType Arity expr ':<>: 'Text " more arguments"

-- | No instance exists for <tt>expr</tt>.
type NoInstanceFor (expr :: k) = 'Text "There is no instance for " ':<>: 'ShowType expr

-- | No instance exists for <tt>tycls (expr :&gt; ...)</tt> because
--   <tt>expr</tt> is not recognised.
type NoInstanceForSub (tycls :: k) (expr :: k') = 'Text "There is no instance for " ':<>: 'ShowType tycls ':<>: 'Text " (" ':<>: 'ShowType expr ':<>: 'Text " :> ...)"
type ErrorIfNoGeneric (routes :: Type -> Type) = Break NoGeneric routes :: Type Rep routes ()

module Servant.API.TypeLevel.List

-- | Append two type-level lists.
--   
--   Import it as
--   
--   <pre>
--   import Servant.API.TypeLevel.List (type (.++))
--   </pre>
type family (l1 :: [Type]) .++ (l2 :: [Type]) :: [Type]


-- | Type-level code for implementing and using <tt>UVerb</tt>. Heavily
--   inspired by <a>world-peace</a>.
module Servant.API.UVerb.Union
type IsMember (a :: u) (as :: [u]) = (Unique as, CheckElemIsMember a as, UElem a as)

-- | Check whether all values in a type-level list are distinct. This will
--   throw a nice error if there are any duplicate elements in the list.
type family Unique (xs :: [k])
type Union = NS I
inject :: UElem x xs => f x -> NS f xs
eject :: UElem x xs => NS f xs -> Maybe (f x)

-- | Convenience function to apply a function to an unknown union element
--   using a type class. All elements of the union must have instances in
--   the type class, and the function is applied unconditionally.
--   
--   See also: <a>matchUnion</a>.
foldMapUnion :: forall c a (as :: [Type]). All c as => Proxy c -> (forall x. c x => x -> a) -> Union as -> a

-- | Convenience function to extract a union element using <tt>cast</tt>,
--   ie. return the value if the selected type happens to be the actual
--   type of the union in this value, or <a>Nothing</a> otherwise.
--   
--   See also: <a>foldMapUnion</a>.
matchUnion :: forall a (as :: [Type]). IsMember a as => Union as -> Maybe a
instance forall a (x :: a) (xs :: [a]). Servant.API.UVerb.Union.UElem x (x : xs)
instance forall a (x :: a) (xs :: [a]) (x' :: a). Servant.API.UVerb.Union.UElem x xs => Servant.API.UVerb.Union.UElem x (x' : xs)


-- | This module provides facilities for adding headers to a response.
--   
--   <pre>
--   &gt;&gt;&gt; let headerVal = addHeader "some-url" 5 :: Headers '[Header "Location" String] Int
--   </pre>
--   
--   The value is added to the header specified by the type
--   (<tt>Location</tt> in the example above).
module Servant.API.ResponseHeaders

-- | Response Header objects. You should never need to construct one
--   directly. Instead, use <a>addOptionalHeader</a>.
data Headers (ls :: [Type]) a
Headers :: a -> HList ls -> Headers (ls :: [Type]) a

-- | The underlying value of a <a>Headers</a>
[getResponse] :: Headers (ls :: [Type]) a -> a

-- | HList of headers.
[getHeadersHList] :: Headers (ls :: [Type]) a -> HList ls
data ResponseHeader (sym :: Symbol) a
Header :: a -> ResponseHeader (sym :: Symbol) a
MissingHeader :: ResponseHeader (sym :: Symbol) a
UndecodableHeader :: ByteString -> ResponseHeader (sym :: Symbol) a
class AddHeader (mods :: [Type]) (h :: Symbol) v orig new | mods h v orig -> new, new -> mods, new -> h, new -> v, new -> orig

-- | <tt>addHeader</tt> adds a header to a response. Note that it changes
--   the type of the value in the following ways:
--   
--   <ol>
--   <li>A simple value is wrapped in "Headers '[hdr]":</li>
--   </ol>
--   
--   <pre>
--   &gt;&gt;&gt; let example0 = addHeader 5 "hi" :: Headers '[Header "someheader" Int] String;
--   
--   &gt;&gt;&gt; getHeaders example0
--   [("someheader","5")]
--   </pre>
--   
--   <ol>
--   <li>A value that already has a header has its new header *prepended*
--   to the existing list:</li>
--   </ol>
--   
--   <pre>
--   &gt;&gt;&gt; let example1 = addHeader 5 "hi" :: Headers '[Header "someheader" Int] String;
--   
--   &gt;&gt;&gt; let example2 = addHeader True example1 :: Headers '[Header "1st" Bool, Header "someheader" Int] String
--   
--   &gt;&gt;&gt; getHeaders example2
--   [("1st","true"),("someheader","5")]
--   </pre>
--   
--   Note that while in your handlers type annotations are not required,
--   since the type can be inferred from the API type, in other cases you
--   may find yourself needing to add annotations.
addHeader :: forall (h :: Symbol) v orig new. AddHeader '[Optional, Strict] h v orig new => v -> orig -> new

-- | Same as <a>addHeader</a> but works with <a>Header'</a>, so it's
--   possible to use any <tt>mods</tt>.
addHeader' :: forall (mods :: [Type]) (h :: Symbol) v orig new. AddHeader mods h v orig new => v -> orig -> new

-- | Deliberately do not add a header to a value.
--   
--   <pre>
--   &gt;&gt;&gt; let example1 = noHeader "hi" :: Headers '[Header "someheader" Int] String
--   
--   &gt;&gt;&gt; getHeaders example1
--   []
--   </pre>
noHeader :: forall (h :: Symbol) v orig new. AddHeader '[Optional, Strict] h v orig new => orig -> new

-- | Same as <a>noHeader</a> but works with <a>Header'</a>, so it's
--   possible to use any <tt>mods</tt>.
noHeader' :: forall (mods :: [Type]) (h :: Symbol) v orig new. AddHeader mods h v orig new => orig -> new
class HasResponseHeader (h :: Symbol) a (headers :: [Type])

-- | Look up a specific ResponseHeader, without having to know what
--   position it is in the HList.
--   
--   <pre>
--   &gt;&gt;&gt; let example1 = addHeader 5 "hi" :: Headers '[Header "someheader" Int] String
--   
--   &gt;&gt;&gt; let example2 = addHeader True example1 :: Headers '[Header "1st" Bool, Header "someheader" Int] String
--   
--   &gt;&gt;&gt; lookupResponseHeader example2 :: ResponseHeader "someheader" Int
--   Header 5
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; lookupResponseHeader example2 :: ResponseHeader "1st" Bool
--   Header True
--   </pre>
--   
--   Usage of this function relies on an explicit type annotation of the
--   header to be looked up. This can be done with type annotations on the
--   result, or with an explicit type application. In this example, the
--   type of header value is determined by the type-inference, we only
--   specify the name of the header:
--   
--   <pre>
--   &gt;&gt;&gt; :set -XTypeApplications
--   
--   &gt;&gt;&gt; case lookupResponseHeader @"1st" example2 of { Header b -&gt; b ; _ -&gt; False }
--   True
--   </pre>
lookupResponseHeader :: forall (h :: Symbol) a (headers :: [Type]) r. HasResponseHeader h a headers => Headers headers r -> ResponseHeader h a
class BuildHeadersTo (hs :: [Type])
buildHeadersTo :: BuildHeadersTo hs => [Header] -> HList hs
class GetHeaders ls
getHeaders :: GetHeaders ls => ls -> [Header]

-- | Auxiliary class for <tt><a>GetHeaders</a> (<a>Headers</a> hs a)</tt>
--   instance
class GetHeaders' (hs :: [Type])
type family HeaderValMap (f :: Type -> Type) (xs :: [Type]) :: [Type]
data HList (a :: [Type])
[HNil] :: HList ('[] :: [Type])
[HCons] :: forall (h :: Symbol) x (xs :: [Type]) (mods :: [Type]). ResponseHeader h x -> HList xs -> HList (Header' mods h x ': xs)
instance (GHC.Internal.TypeLits.KnownSymbol h, Web.Internal.HttpApiData.ToHttpApiData v) => Servant.API.ResponseHeaders.AddHeader mods h v (Servant.API.ResponseHeaders.Headers (fst : rest) a) (Servant.API.ResponseHeaders.Headers (Servant.API.Header.Header' mods h v : fst : rest) a)
instance Servant.API.ResponseHeaders.AddHeader mods h v old new => Servant.API.ResponseHeaders.AddHeader mods h v (Servant.API.UVerb.Union.Union '[old]) (Servant.API.UVerb.Union.Union '[new])
instance (Servant.API.ResponseHeaders.AddHeader mods h v old new, Servant.API.ResponseHeaders.AddHeader mods h v (Servant.API.UVerb.Union.Union oldrest) (Servant.API.UVerb.Union.Union newrest), oldrest GHC.Types.~ (a : as), newrest GHC.Types.~ (b : bs)) => Servant.API.ResponseHeaders.AddHeader mods h v (Servant.API.UVerb.Union.Union (old : a : as)) (Servant.API.UVerb.Union.Union (new : b : bs))
instance (GHC.Internal.TypeLits.KnownSymbol h, Web.Internal.HttpApiData.ToHttpApiData v, new GHC.Types.~ Servant.API.ResponseHeaders.Headers '[Servant.API.Header.Header' mods h v] a) => Servant.API.ResponseHeaders.AddHeader mods h v a new
instance (Web.Internal.HttpApiData.FromHttpApiData v, Servant.API.ResponseHeaders.BuildHeadersTo xs, GHC.Internal.TypeLits.KnownSymbol h) => Servant.API.ResponseHeaders.BuildHeadersTo (Servant.API.Header.Header' mods h v : xs)
instance Servant.API.ResponseHeaders.BuildHeadersTo '[]
instance GHC.Classes.Eq a => GHC.Classes.Eq (Servant.API.ResponseHeaders.ResponseHeader sym a)
instance GHC.Internal.Base.Functor (Servant.API.ResponseHeaders.Headers ls)
instance GHC.Internal.Base.Functor (Servant.API.ResponseHeaders.ResponseHeader sym)
instance (GHC.Internal.TypeLits.KnownSymbol h, Servant.API.ResponseHeaders.GetHeadersFromHList rest, Web.Internal.HttpApiData.ToHttpApiData v) => Servant.API.ResponseHeaders.GetHeaders' (Servant.API.Header.Header' mods h v : rest)
instance Servant.API.ResponseHeaders.GetHeaders' '[]
instance (GHC.Internal.TypeLits.KnownSymbol h, Web.Internal.HttpApiData.ToHttpApiData x, Servant.API.ResponseHeaders.GetHeadersFromHList xs) => Servant.API.ResponseHeaders.GetHeadersFromHList (Servant.API.Header.Header' mods h x : xs)
instance Servant.API.ResponseHeaders.GetHeadersFromHList '[]
instance Servant.API.ResponseHeaders.GetHeadersFromHList hs => Servant.API.ResponseHeaders.GetHeaders (Servant.API.ResponseHeaders.HList hs)
instance Servant.API.ResponseHeaders.GetHeaders' hs => Servant.API.ResponseHeaders.GetHeaders (Servant.API.ResponseHeaders.Headers hs a)
instance Servant.API.ResponseHeaders.HasResponseHeader h a (Servant.API.Header.Header' mods h a : rest)
instance Servant.API.ResponseHeaders.HasResponseHeader h a rest => Servant.API.ResponseHeaders.HasResponseHeader h a (first : rest)
instance (y GHC.Types.~ Servant.API.Header.Header' mods h x, Control.DeepSeq.NFData x, Servant.API.ResponseHeaders.NFDataHList xs) => Servant.API.ResponseHeaders.NFDataHList (y : xs)
instance Servant.API.ResponseHeaders.NFDataHList '[]
instance Servant.API.ResponseHeaders.NFDataHList xs => Control.DeepSeq.NFData (Servant.API.ResponseHeaders.HList xs)
instance (Servant.API.ResponseHeaders.NFDataHList ls, Control.DeepSeq.NFData a) => Control.DeepSeq.NFData (Servant.API.ResponseHeaders.Headers ls a)
instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Servant.API.ResponseHeaders.ResponseHeader sym a)
instance GHC.Internal.Show.Show a => GHC.Internal.Show.Show (Servant.API.ResponseHeaders.ResponseHeader sym a)


-- | An alternative to <tt>Verb</tt> for end-points that respond with a
--   resource value of any of an open union of types, and specific status
--   codes for each type in this union. (<a>UVerb</a> is short for
--   <tt>UnionVerb</tt>)
--   
--   This can be used for returning (rather than throwing) exceptions in a
--   server as in, say <tt>'[Report, WaiError]</tt>; or responding with
--   either a 303 forward with a location header, or 201 created with a
--   different body type, depending on the circumstances. (All of this can
--   be done with vanilla servant-server by throwing exceptions, but it
--   can't be represented in the API types without something like
--   <a>UVerb</a>.)
--   
--   See
--   <a>https://docs.servant.dev/en/stable/cookbook/uverb/UVerb.html</a>
--   for a working example.
module Servant.API.UVerb

-- | A variant of <tt>Verb</tt> that can have any of a number of response
--   values and status codes.
--   
--   FUTUREWORK: it would be nice to make <tt>Verb</tt> a special case of
--   <a>UVerb</a>, and only write instances for <tt>HasServer</tt> etc. for
--   the latter, getting them for the former for free. Something like:
--   
--   <pre>
--   type Verb method statusCode contentTypes a = UVerb method contentTypes [WithStatus statusCode a]
--   </pre>
--   
--   Backwards compatibility is tricky, though: this type alias would mean
--   people would have to use <tt>respond</tt> instead of <a>pure</a> or
--   <a>return</a>, so all old handlers would have to be rewritten.
data UVerb (method :: StdMethod) (contentTypes :: [Type]) (as :: [Type])
class KnownStatus StatusOf a => HasStatus a where {
    type StatusOf a :: Nat;
}
statusOf :: HasStatus a => proxy a -> Status
class HasStatuses (as :: [Type]) where {
    type Statuses (as :: [Type]) :: [Nat];
}
statuses :: HasStatuses as => Proxy as -> [Status]

-- | A simple newtype wrapper that pairs a type with its status code. It
--   implements all the content types that Servant ships with by default.
newtype WithStatus (k :: Nat) a
WithStatus :: a -> WithStatus (k :: Nat) a
instance GHC.Classes.Eq a => GHC.Classes.Eq (Servant.API.UVerb.WithStatus k a)
instance Servant.API.UVerb.HasStatus a => Servant.API.UVerb.HasStatus (Servant.API.ResponseHeaders.Headers ls a)
instance Servant.API.UVerb.HasStatus Servant.API.ContentTypes.NoContent
instance Servant.API.Status.KnownStatus n => Servant.API.UVerb.HasStatus (Servant.API.UVerb.WithStatus n a)
instance (Servant.API.UVerb.HasStatus a, Servant.API.UVerb.HasStatuses as) => Servant.API.UVerb.HasStatuses (a : as)
instance Servant.API.UVerb.HasStatuses '[]
instance Servant.API.ContentTypes.MimeRender Servant.API.ContentTypes.FormUrlEncoded a => Servant.API.ContentTypes.MimeRender Servant.API.ContentTypes.FormUrlEncoded (Servant.API.UVerb.WithStatus _status a)
instance Servant.API.ContentTypes.MimeRender Servant.API.ContentTypes.JSON a => Servant.API.ContentTypes.MimeRender Servant.API.ContentTypes.JSON (Servant.API.UVerb.WithStatus _status a)
instance Servant.API.ContentTypes.MimeRender Servant.API.ContentTypes.OctetStream a => Servant.API.ContentTypes.MimeRender Servant.API.ContentTypes.OctetStream (Servant.API.UVerb.WithStatus _status a)
instance Servant.API.ContentTypes.MimeRender Servant.API.ContentTypes.PlainText a => Servant.API.ContentTypes.MimeRender Servant.API.ContentTypes.PlainText (Servant.API.UVerb.WithStatus _status a)
instance Servant.API.ContentTypes.MimeUnrender Servant.API.ContentTypes.FormUrlEncoded a => Servant.API.ContentTypes.MimeUnrender Servant.API.ContentTypes.FormUrlEncoded (Servant.API.UVerb.WithStatus _status a)
instance Servant.API.ContentTypes.MimeUnrender Servant.API.ContentTypes.JSON a => Servant.API.ContentTypes.MimeUnrender Servant.API.ContentTypes.JSON (Servant.API.UVerb.WithStatus _status a)
instance Servant.API.ContentTypes.MimeUnrender Servant.API.ContentTypes.OctetStream a => Servant.API.ContentTypes.MimeUnrender Servant.API.ContentTypes.OctetStream (Servant.API.UVerb.WithStatus _status a)
instance Servant.API.ContentTypes.MimeUnrender Servant.API.ContentTypes.PlainText a => Servant.API.ContentTypes.MimeUnrender Servant.API.ContentTypes.PlainText (Servant.API.UVerb.WithStatus _status a)
instance GHC.Internal.Show.Show a => GHC.Internal.Show.Show (Servant.API.UVerb.WithStatus k a)

module Servant.API.Vault
type Vault = Vault RealWorld

module Servant.API.Verbs

-- | <a>DELETE</a> with 200 status code.
type Delete = Verb 'DELETE 200

-- | <a>DELETE</a> with 202 status code.
type DeleteAccepted = Verb 'DELETE 202

-- | <a>DELETE</a> with 204 status code.
type DeleteNoContent = NoContentVerb 'DELETE

-- | <a>DELETE</a> with 203 status code.
type DeleteNonAuthoritative = Verb 'DELETE 203

-- | <a>DELETE</a> with 205 status code.
type DeleteResetContent = Verb 'DELETE 205

-- | <a>GET</a> with 200 status code.
type Get = Verb 'GET 200

-- | <a>GET</a> with 202 status code.
type GetAccepted = Verb 'GET 202

-- | <a>GET</a> with 204 status code.
type GetNoContent = NoContentVerb 'GET

-- | <a>GET</a> with 203 status code.
type GetNonAuthoritative = Verb 'GET 203

-- | <a>GET</a> with 206 status code.
type GetPartialContent = Verb 'GET 206

-- | <a>GET</a> with 205 status code.
type GetResetContent = Verb 'GET 205

-- | <a>HEAD</a> with 204 status code.
type HeadNoContent = NoContentVerb 'HEAD

-- | <tt>NoContentVerb</tt> is a specific type to represent
--   <tt>NoContent</tt> responses. It does not require either a list of
--   content types (because there's no content) or a status code (because
--   it should always be 204).
data NoContentVerb (method :: k1)

-- | <a>PATCH</a> with 200 status code.
type Patch = Verb 'PATCH 200

-- | <a>PATCH</a> with 202 status code.
type PatchAccepted = Verb 'PATCH 202

-- | <a>PATCH</a> with 204 status code.
type PatchNoContent = NoContentVerb 'PATCH

-- | <a>PATCH</a> with 203 status code.
type PatchNonAuthoritative = Verb 'PATCH 203

-- | <a>PATCH</a> with 205 status code.
type PatchResetContent = Verb 'PATCH 205

-- | <a>POST</a> with 200 status code.
type Post = Verb 'POST 200

-- | <a>POST</a> with 202 status code.
type PostAccepted = Verb 'POST 202

-- | <a>POST</a> with 201 status code.
type PostCreated = Verb 'POST 201

-- | <a>POST</a> with 204 status code.
type PostNoContent = NoContentVerb 'POST

-- | <a>POST</a> with 203 status code.
type PostNonAuthoritative = Verb 'POST 203

-- | <a>POST</a> with 205 status code.
type PostResetContent = Verb 'POST 205

-- | <a>PUT</a> with 200 status code.
type Put = Verb 'PUT 200

-- | <a>PUT</a> with 202 status code.
type PutAccepted = Verb 'PUT 202

-- | <a>PUT</a> with 201 status code.
type PutCreated = Verb 'PUT 201

-- | <a>PUT</a> with 204 status code.
type PutNoContent = NoContentVerb 'PUT

-- | <a>PUT</a> with 203 status code.
type PutNonAuthoritative = Verb 'PUT 203

-- | <a>PUT</a> with 205 status code.
type PutResetContent = Verb 'PUT 205
class ReflectMethod (a :: k)
reflectMethod :: ReflectMethod a => Proxy a -> Method

-- | <tt>Verb</tt> is a general type for representing HTTP verbs (a.k.a.
--   methods). For convenience, type synonyms for each verb with a 200
--   response code are provided, but you are free to define your own:
--   
--   <pre>
--   &gt;&gt;&gt; type Post204 contentTypes a = Verb 'POST 204 contentTypes a
--   </pre>
data Verb (method :: k1) (statusCode :: Nat) (contentTypes :: [Type]) a
data StdMethod
GET :: StdMethod
POST :: StdMethod
HEAD :: StdMethod
PUT :: StdMethod
DELETE :: StdMethod
TRACE :: StdMethod
CONNECT :: StdMethod
OPTIONS :: StdMethod
PATCH :: StdMethod
instance forall k1 (method :: k1). GHC.Internal.Generics.Generic (Servant.API.Verbs.NoContentVerb method)
instance forall k1 (method :: k1) (statusCode :: GHC.Internal.TypeNats.Nat) (contentTypes :: [GHC.Types.Type]) a. GHC.Internal.Generics.Generic (Servant.API.Verbs.Verb method statusCode contentTypes a)
instance Servant.API.Verbs.ReflectMethod 'Network.HTTP.Types.Method.CONNECT
instance Servant.API.Verbs.ReflectMethod 'Network.HTTP.Types.Method.DELETE
instance Servant.API.Verbs.ReflectMethod 'Network.HTTP.Types.Method.GET
instance Servant.API.Verbs.ReflectMethod 'Network.HTTP.Types.Method.HEAD
instance Servant.API.Verbs.ReflectMethod 'Network.HTTP.Types.Method.OPTIONS
instance Servant.API.Verbs.ReflectMethod 'Network.HTTP.Types.Method.PATCH
instance Servant.API.Verbs.ReflectMethod 'Network.HTTP.Types.Method.POST
instance Servant.API.Verbs.ReflectMethod 'Network.HTTP.Types.Method.PUT
instance Servant.API.Verbs.ReflectMethod 'Network.HTTP.Types.Method.TRACE


-- | This module collects utilities for manipulating <tt>servant</tt> API
--   types. The functionality in this module is for advanced usage.
--   
--   The code samples in this module use the following type synonym:
--   
--   <pre>
--   type SampleAPI = "hello" :&gt; Get '[JSON] Int
--               :&lt;|&gt; "bye" :&gt; Capture "name" String :&gt; Post '[JSON, PlainText] Bool
--   </pre>
module Servant.API.TypeLevel

-- | Flatten API into a list of endpoints.
--   
--   <pre>
--   &gt;&gt;&gt; Refl :: Endpoints SampleAPI :~: '["hello" :&gt; Verb 'GET 200 '[JSON] Int, "bye" :&gt; (Capture "name" String :&gt; Verb 'POST 200 '[JSON, PlainText] Bool)]
--   Refl
--   </pre>
type family Endpoints api :: [Type]

-- | You may use this type family to tell the type checker that your custom
--   type may be skipped as part of a link. This is useful for things like
--   <tt><a>QueryParam</a></tt> that are optional in a URI and do not
--   affect them if they are omitted.
--   
--   <pre>
--   &gt;&gt;&gt; data CustomThing
--   
--   &gt;&gt;&gt; type instance IsElem' e (CustomThing :&gt; s) = IsElem e s
--   </pre>
--   
--   Note that <tt><a>IsElem</a></tt> is called, which will mutually
--   recurse back to <tt><a>IsElem'</a></tt> if it exhausts all other
--   options again.
--   
--   Once you have written a <tt>HasLink</tt> instance for
--   <tt>CustomThing</tt> you are ready to go.
type family IsElem' a s

-- | Closed type family, check if <tt>endpoint</tt> is within <tt>api</tt>.
--   Uses <tt><a>IsElem'</a></tt> if it exhausts all other options.
--   
--   <pre>
--   &gt;&gt;&gt; ok (Proxy :: Proxy (IsElem ("hello" :&gt; Get '[JSON] Int) SampleAPI))
--   OK
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; ok (Proxy :: Proxy (IsElem ("bye" :&gt; Get '[JSON] Int) SampleAPI))
--   ...
--   ... Could not ...
--   ...
--   </pre>
--   
--   An endpoint is considered within an api even if it is missing
--   combinators that don't affect the URL:
--   
--   <pre>
--   &gt;&gt;&gt; ok (Proxy :: Proxy (IsElem (Get '[JSON] Int) (Header "h" Bool :&gt; Get '[JSON] Int)))
--   OK
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; ok (Proxy :: Proxy (IsElem (Get '[JSON] Int) (ReqBody '[JSON] Bool :&gt; Get '[JSON] Int)))
--   OK
--   </pre>
--   
--   <ul>
--   <li>N.B.:* <tt>IsElem a b</tt> can be seen as capturing the notion of
--   whether the URL represented by <tt>a</tt> would match the URL
--   represented by <tt>b</tt>, *not* whether a request represented by
--   <tt>a</tt> matches the endpoints serving <tt>b</tt> (for the latter,
--   use <a>IsIn</a>).</li>
--   </ul>
type family IsElem endpoint api

-- | Check whether <tt>sub</tt> is a sub-API of <tt>api</tt>.
--   
--   <pre>
--   &gt;&gt;&gt; ok (Proxy :: Proxy (IsSubAPI SampleAPI (SampleAPI :&lt;|&gt; Get '[JSON] Int)))
--   OK
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; ok (Proxy :: Proxy (IsSubAPI (SampleAPI :&lt;|&gt; Get '[JSON] Int) SampleAPI))
--   ...
--   ... Could not ...
--   ...
--   </pre>
--   
--   This uses <tt>IsElem</tt> for checking; thus the note there applies
--   here.
type family IsSubAPI sub api

-- | Check that every element of <tt>xs</tt> is an endpoint of <tt>api</tt>
--   (using <tt><a>IsElem</a></tt>).
type family AllIsElem (xs :: [Type]) api

-- | Closed type family, check if <tt>endpoint</tt> is exactly within
--   <tt>api</tt>.
--   
--   <pre>
--   &gt;&gt;&gt; ok (Proxy :: Proxy (IsIn ("hello" :&gt; Get '[JSON] Int) SampleAPI))
--   OK
--   </pre>
--   
--   Unlike <a>IsElem</a>, this requires an *exact* match.
--   
--   <pre>
--   &gt;&gt;&gt; ok (Proxy :: Proxy (IsIn (Get '[JSON] Int) (Header "h" Bool :&gt; Get '[JSON] Int)))
--   ...
--   ... Could not ...
--   ...
--   </pre>
type family IsIn endpoint api

-- | Check whether <tt>sub</tt> is a sub API of <tt>api</tt>.
--   
--   Like <a>IsSubAPI</a>, but uses <a>IsIn</a> rather than <a>IsElem</a>.
type family IsStrictSubAPI sub api

-- | Check that every element of <tt>xs</tt> is an endpoint of <tt>api</tt>
--   (using <tt><a>IsIn</a></tt>).
--   
--   <pre>
--   &gt;&gt;&gt; ok (Proxy :: Proxy (AllIsIn (Endpoints SampleAPI) SampleAPI))
--   OK
--   </pre>
type family AllIsIn (xs :: [Type]) api

-- | Apply <tt>(e :&gt;)</tt> to every API in <tt>xs</tt>.
type family MapSub (e :: k) (xs :: [Type]) :: [Type]

-- | Append two type-level lists.
type family AppendList (xs :: [a]) (ys :: [a]) :: [a]
type family IsSubList (a :: [t]) (b :: [t])

-- | Check that a value is an element of a list:
--   
--   <pre>
--   &gt;&gt;&gt; ok (Proxy :: Proxy (Elem Bool '[Int, Bool]))
--   OK
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; ok (Proxy :: Proxy (Elem String '[Int, Bool]))
--   ...
--   ... [Char]...'[Int, Bool...
--   ...
--   </pre>
type Elem (e :: t) (es :: [t]) = ElemGo e es es
type family ElemGo (e :: t) (es :: [t]) (orig :: t1)

-- | If either <tt>a</tt> or <tt>b</tt> produce an empty constraint,
--   produce an empty constraint.
type family Or a b

-- | If both <tt>a</tt> or <tt>b</tt> produce an empty constraint, produce
--   an empty constraint.
type family And a b
type family FragmentUnique api

-- | If there is more than one fragment in an API endpoint, a compile-time
--   error is raised.
--   
--   <pre>
--   &gt;&gt;&gt; type FailAPI = Fragment Bool :&gt; Fragment Int :&gt; Get '[JSON] NoContent
--   
--   &gt;&gt;&gt; instance AtMostOneFragment FailAPI
--   ...
--   ...Only one Fragment allowed per endpoint in api...
--   ...
--   </pre>
class FragmentUnique api => AtMostOneFragment api
instance Servant.API.TypeLevel.AtMostOneFragment (Servant.API.Fragment.Fragment a)
instance Servant.API.TypeLevel.AtMostOneFragment (Servant.API.UVerb.UVerb m cts as)
instance forall k1 (m :: k1) (s :: GHC.Internal.TypeNats.Nat) (ct :: [GHC.Types.Type]) typ. Servant.API.TypeLevel.AtMostOneFragment (Servant.API.Verbs.Verb m s ct typ)

module Servant.API.WithNamedContext

-- | <a>WithNamedContext</a> names a specific tagged context to use for the
--   combinators in the API. (See also in <tt>servant-server</tt>,
--   <tt>Servant.Server.Context</tt>.) For example:
--   
--   <pre>
--   type UseNamedContextAPI = WithNamedContext "myContext" '[String] (
--       ReqBody '[JSON] Int :&gt; Get '[JSON] Int)
--   </pre>
--   
--   Both the <tt>ReqBody</tt> and <tt>Get</tt> combinators will use the
--   <a>WithNamedContext</a> with type tag "myContext" as their context.
--   
--   <tt>Context</tt>s are only relevant for <tt>servant-server</tt>.
--   
--   For more information, see the tutorial.
data WithNamedContext (name :: Symbol) (subContext :: [Type]) (subApi :: k)

module Servant.API.WithResource
data WithResource (res :: k)


-- | This module offers other servant libraries a minimalistic HTTP
--   response type.
--   
--   It is purely an internal API and SHOULD NOT be used by end-users of
--   Servant.
module Servant.Types.Internal.Response
data InternalResponse a
InternalResponse :: Status -> Seq Header -> a -> InternalResponse a
[statusCode] :: InternalResponse a -> Status
[headers] :: InternalResponse a -> Seq Header
[responseBody] :: InternalResponse a -> a
instance GHC.Classes.Eq a => GHC.Classes.Eq (Servant.Types.Internal.Response.InternalResponse a)
instance GHC.Internal.Data.Foldable.Foldable Servant.Types.Internal.Response.InternalResponse
instance GHC.Internal.Base.Functor Servant.Types.Internal.Response.InternalResponse
instance GHC.Internal.Generics.Generic (Servant.Types.Internal.Response.InternalResponse a)
instance GHC.Internal.Show.Show a => GHC.Internal.Show.Show (Servant.Types.Internal.Response.InternalResponse a)
instance GHC.Internal.Data.Traversable.Traversable Servant.Types.Internal.Response.InternalResponse

module Servant.Types.SourceT

-- | This is CPSised ListT.
newtype SourceT (m :: Type -> Type) a
SourceT :: (forall b. () => (StepT m a -> m b) -> m b) -> SourceT (m :: Type -> Type) a
[unSourceT] :: SourceT (m :: Type -> Type) a -> forall b. () => (StepT m a -> m b) -> m b
mapStepT :: forall (m :: Type -> Type) a b. (StepT m a -> StepT m b) -> SourceT m a -> SourceT m b

-- | <tt>ListT</tt> with additional constructors.
data StepT (m :: Type -> Type) a
Stop :: StepT (m :: Type -> Type) a
Error :: String -> StepT (m :: Type -> Type) a
Skip :: StepT m a -> StepT (m :: Type -> Type) a
Yield :: a -> StepT m a -> StepT (m :: Type -> Type) a
Effect :: m (StepT m a) -> StepT (m :: Type -> Type) a

-- | Create <a>SourceT</a> from <tt>Step</tt>.
--   
--   <i>Note:</i> often enough you want to use <a>SourceT</a> directly.
fromStepT :: forall (m :: Type -> Type) a. StepT m a -> SourceT m a

-- | Create pure <a>SourceT</a>.
--   
--   <pre>
--   &gt;&gt;&gt; source "foo" :: SourceT Identity Char
--   fromStepT (Effect (Identity (Yield 'f' (Yield 'o' (Yield 'o' Stop)))))
--   </pre>
source :: forall f a (m :: Type -> Type). Foldable f => f a -> SourceT m a

-- | Get the answers.
--   
--   <pre>
--   &gt;&gt;&gt; runSourceT (source "foo" :: SourceT Identity Char)
--   ExceptT (Identity (Right "foo"))
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; runSourceT (source "foo" :: SourceT [] Char)
--   ExceptT [Right "foo"]
--   </pre>
runSourceT :: forall (m :: Type -> Type) a. Monad m => SourceT m a -> ExceptT String m [a]
runStepT :: forall (m :: Type -> Type) a. Monad m => StepT m a -> ExceptT String m [a]

-- | Filter values.
--   
--   <pre>
--   &gt;&gt;&gt; toList $ mapMaybe (\x -&gt; if odd x then Just x else Nothing) (source [0..10]) :: [Int]
--   [1,3,5,7,9]
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; mapMaybe (\x -&gt; if odd x then Just x else Nothing) (source [0..2]) :: SourceT Identity Int
--   fromStepT (Effect (Identity (Skip (Yield 1 (Skip Stop)))))
--   </pre>
--   
--   Illustrates why we need <a>Skip</a>.
mapMaybe :: forall (m :: Type -> Type) a b. Functor m => (a -> Maybe b) -> SourceT m a -> SourceT m b
mapMaybeStep :: forall (m :: Type -> Type) a b. Functor m => (a -> Maybe b) -> StepT m a -> StepT m b

-- | Run action for each value in the <a>SourceT</a>.
--   
--   <pre>
--   &gt;&gt;&gt; foreach fail print $ source ("abc" :: String)
--   'a'
--   'b'
--   'c'
--   </pre>
foreach :: Monad m => (String -> m ()) -> (a -> m ()) -> SourceT m a -> m ()

-- | See <a>foreach</a>.
foreachStep :: Monad m => (String -> m ()) -> (a -> m ()) -> StepT m a -> m ()

-- | Traverse the <a>StepT</a> and call the given function for each
--   <a>Yield</a>.
foreachYieldStep :: forall (m :: Type -> Type) a b. Functor m => (a -> StepT m b -> StepT m b) -> StepT m a -> StepT m b
fromAction :: Functor m => (a -> Bool) -> m a -> SourceT m a
fromActionStep :: Functor m => (a -> Bool) -> m a -> StepT m a

-- | Read file.
--   
--   <pre>
--   &gt;&gt;&gt; foreach fail BS.putStr (readFile "servant.cabal")
--   cabal-version:      3.0
--   name:               servant
--   ...
--   </pre>
readFile :: FilePath -> SourceT IO ByteString

-- | Transform using <tt>attoparsec</tt> parser.
--   
--   Note: <tt>parser</tt> should not accept empty input!
--   
--   <pre>
--   &gt;&gt;&gt; let parser = A.skipWhile A8.isSpace_w8 &gt;&gt; A.takeWhile1 A8.isDigit_w8
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; runExcept $ runSourceT $ transformWithAtto parser (source $ [fromString "1 2 3"])
--   Right ["1","2","3"]
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; runExcept $ runSourceT $ transformWithAtto parser (source $ map fromString ["1", "2", "3"])
--   Right ["123"]
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; runExcept $ runSourceT $ transformWithAtto parser (source $ map fromString ["1", "2 3", "4"])
--   Right ["12","34"]
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; runExcept $ runSourceT $ transformWithAtto parser (source [fromString "foobar"])
--   Left "Failed reading: takeWhile1"
--   </pre>
transformWithAtto :: forall (m :: Type -> Type) a. Monad m => Parser a -> SourceT m ByteString -> SourceT m a
transformStepWithAtto :: forall a (m :: Type -> Type). Monad m => Parser a -> StepT m ByteString -> StepT m a
instance (Test.QuickCheck.Arbitrary.Arbitrary a, GHC.Internal.Base.Monad m) => Test.QuickCheck.Arbitrary.Arbitrary (Servant.Types.SourceT.SourceT m a)
instance (Test.QuickCheck.Arbitrary.Arbitrary a, GHC.Internal.Base.Monad m) => Test.QuickCheck.Arbitrary.Arbitrary (Servant.Types.SourceT.StepT m a)
instance (GHC.Internal.Data.Functor.Identity.Identity GHC.Types.~ m) => GHC.Internal.Data.Foldable.Foldable (Servant.Types.SourceT.SourceT m)
instance (GHC.Internal.Data.Functor.Identity.Identity GHC.Types.~ m) => GHC.Internal.Data.Foldable.Foldable (Servant.Types.SourceT.StepT m)
instance GHC.Internal.Base.Functor m => GHC.Internal.Base.Functor (Servant.Types.SourceT.SourceT m)
instance GHC.Internal.Base.Functor m => GHC.Internal.Base.Functor (Servant.Types.SourceT.StepT m)
instance Control.Monad.Morph.MFunctor Servant.Types.SourceT.SourceT
instance Control.Monad.Morph.MFunctor Servant.Types.SourceT.StepT
instance GHC.Internal.Base.Functor m => GHC.Internal.Base.Monoid (Servant.Types.SourceT.SourceT m a)
instance GHC.Internal.Base.Functor m => GHC.Internal.Base.Monoid (Servant.Types.SourceT.StepT m a)
instance GHC.Internal.Base.Functor m => GHC.Internal.Base.Semigroup (Servant.Types.SourceT.SourceT m a)
instance GHC.Internal.Base.Functor m => GHC.Internal.Base.Semigroup (Servant.Types.SourceT.StepT m a)
instance (GHC.Internal.Base.Applicative m, Data.Functor.Classes.Show1 m) => Data.Functor.Classes.Show1 (Servant.Types.SourceT.SourceT m)
instance (GHC.Internal.Base.Applicative m, Data.Functor.Classes.Show1 m) => Data.Functor.Classes.Show1 (Servant.Types.SourceT.StepT m)
instance (GHC.Internal.Base.Applicative m, Data.Functor.Classes.Show1 m, GHC.Internal.Show.Show a) => GHC.Internal.Show.Show (Servant.Types.SourceT.SourceT m a)
instance (GHC.Internal.Base.Applicative m, Data.Functor.Classes.Show1 m, GHC.Internal.Show.Show a) => GHC.Internal.Show.Show (Servant.Types.SourceT.StepT m a)

module Servant.API.Stream

-- | A Stream endpoint for a given method emits a stream of encoded values
--   at a given <tt>Content-Type</tt>, delimited by a <tt>framing</tt>
--   strategy. Type synonyms are provided for standard methods.
data Stream (method :: k1) (status :: Nat) framing contentType a
type StreamGet = Stream 'GET 200
type StreamPost = Stream 'POST 200

-- | A stream request body.
type StreamBody = StreamBody' '[] :: [Type]
data StreamBody' (mods :: [Type]) framing contentType a

-- | Stream endpoints may be implemented as producing a <tt><a>SourceIO</a>
--   chunk</tt>.
--   
--   Clients reading from streaming endpoints can be implemented as
--   consuming a <tt><a>SourceIO</a> chunk</tt>.
type SourceIO = SourceT IO

-- | <a>ToSourceIO</a> is intended to be implemented for types such as
--   Conduit, Pipe, etc. By implementing this class, all such streaming
--   abstractions can be used directly as endpoints.
class ToSourceIO chunk a | a -> chunk
toSourceIO :: ToSourceIO chunk a => a -> SourceIO chunk

-- | <a>FromSourceIO</a> is intended to be implemented for types such as
--   Conduit, Pipe, etc. By implementing this class, all such streaming
--   abstractions can be used directly on the client side for talking to
--   streaming endpoints.
class FromSourceIO chunk a | a -> chunk
fromSourceIO :: FromSourceIO chunk a => SourceIO chunk -> IO a

-- | Auxiliary class for <tt><a>ToSourceIO</a> x (<a>SourceT</a> m x)</tt>
--   instance.
class SourceToSourceIO (m :: Type -> Type)
sourceToSourceIO :: SourceToSourceIO m => SourceT m a -> SourceT IO a

-- | The <a>FramingRender</a> class provides the logic for emitting a
--   framing strategy. The strategy transforms a <tt><a>SourceT</a> m
--   a</tt> into <tt><a>SourceT</a> m <a>ByteString</a></tt>, therefore it
--   can prepend, append and intercalate <i>framing</i> structure around
--   chunks.
--   
--   <i>Note:</i> as the <tt><a>Monad</a> m</tt> is generic, this is pure
--   transformation.
class FramingRender (strategy :: k)
framingRender :: forall (m :: Type -> Type) a. (FramingRender strategy, Monad m) => Proxy strategy -> (a -> ByteString) -> SourceT m a -> SourceT m ByteString

-- | The <a>FramingUnrender</a> class provides the logic for parsing a
--   framing strategy.
class FramingUnrender (strategy :: k)
framingUnrender :: forall (m :: Type -> Type) a. (FramingUnrender strategy, Monad m) => Proxy strategy -> (ByteString -> Either String a) -> SourceT m ByteString -> SourceT m a

-- | A framing strategy that does not do any framing at all, it just passes
--   the input data This will be used most of the time with binary data,
--   such as files
data NoFraming

-- | A simple framing strategy that has no header, and inserts a newline
--   character after each frame. This assumes that it is used with a
--   Content-Type that encodes without newlines (e.g. JSON).
data NewlineFraming

-- | The netstring framing strategy as defined by djb:
--   <a>http://cr.yp.to/proto/netstrings.txt</a>
--   
--   Any string of 8-bit bytes may be encoded as
--   <tt>[len]":"[string]","</tt>. Here <tt>[string]</tt> is the string and
--   <tt>[len]</tt> is a nonempty sequence of ASCII digits giving the
--   length of <tt>[string]</tt> in decimal. The ASCII digits are
--   <tt><a>30</a></tt> for 0, <tt><a>31</a></tt> for 1, and so on up
--   through <tt><a>39</a></tt> for 9. Extra zeros at the front of
--   <tt>[len]</tt> are prohibited: <tt>[len]</tt> begins with
--   <tt><a>30</a></tt> exactly when <tt>[string]</tt> is empty.
--   
--   For example, the string <tt>"hello world!"</tt> is encoded as
--   <tt><a>32 3a 68 65 6c 6c 6f 20 77 6f 72 6c 64 21 2c</a></tt>, i.e.,
--   <tt>"12:hello world!,"</tt>. The empty string is encoded as
--   <tt>"0:,"</tt>.
data NetstringFraming
instance Servant.API.Stream.FramingRender Servant.API.Stream.NetstringFraming
instance Servant.API.Stream.FramingRender Servant.API.Stream.NewlineFraming
instance Servant.API.Stream.FramingRender Servant.API.Stream.NoFraming
instance Servant.API.Stream.FramingUnrender Servant.API.Stream.NetstringFraming
instance Servant.API.Stream.FramingUnrender Servant.API.Stream.NewlineFraming
instance Servant.API.Stream.FramingUnrender Servant.API.Stream.NoFraming
instance GHC.Internal.Control.Monad.IO.Class.MonadIO m => Servant.API.Stream.FromSourceIO a (Servant.Types.SourceT.SourceT m a)
instance forall k1 (method :: k1) (status :: GHC.Internal.TypeNats.Nat) framing contentType a. GHC.Internal.Generics.Generic (Servant.API.Stream.Stream method status framing contentType a)
instance GHC.Internal.Generics.Generic (Servant.API.Stream.StreamBody' mods framing contentType a)
instance Servant.API.Stream.SourceToSourceIO GHC.Types.IO
instance Servant.API.Stream.ToSourceIO a [a]
instance Servant.API.Stream.ToSourceIO a (GHC.Internal.Base.NonEmpty a)
instance Servant.API.Stream.SourceToSourceIO m => Servant.API.Stream.ToSourceIO chunk (Servant.Types.SourceT.SourceT m chunk)


-- | MultiVerb is a part of the type-level eDSL that allows you to express
--   complex routes while retaining a high level of precision with good
--   ergonomics.
module Servant.API.MultiVerb

-- | <a>MultiVerb</a> produces an endpoint which can return multiple values
--   with various content types and status codes. It is similar to
--   <a>UVerb</a> and behaves similarly, but it has some important
--   differences:
--   
--   <ul>
--   <li>Descriptions and statuses can be attached to individual responses
--   without using wrapper types and without affecting the handler return
--   type.</li>
--   <li>The return type of the handler can be decoupled from the types of
--   the individual responses. One can use a <a>Union</a> type just like
--   for <a>UVerb</a>, but <a>MultiVerb</a> also supports using an
--   arbitrary type with an <a>AsUnion</a> instance. Each response is
--   responsible for their content type.</li>
--   <li>Headers can be attached to individual responses, also without
--   affecting the handler return type.</li>
--   </ul>
--   
--   <h4><b>Example</b></h4>
--   
--   Let us create an endpoint that captures an <a>Int</a> and has the
--   following logic:
--   
--   <ul>
--   <li>If the number is negative, we return status code 400 and an empty
--   body;</li>
--   <li>If the number is even, we return a <a>Bool</a> in the response
--   body;</li>
--   <li>If the number is odd, we return another <a>Int</a> in the response
--   body.</li>
--   </ul>
--   
--   <pre>
--   import qualified Generics.SOP as GSOP
--   </pre>
--   
--   <pre>
--   -- All possible HTTP responses
--   type Responses =
--     '[ type RespondEmpty 400 "Negative"
--      , type Respond 200 "Even number" Bool
--      , type Respond 200 "Odd number" Int
--      ]
--   
--   -- All possible return types
--   data Result
--     = NegativeNumber
--     | Odd Int
--     | Even Bool
--     deriving stock (Generic)
--     deriving (AsUnion Responses)
--       via GenericAsUnion Responses Result
--   
--   instance GSOP.Generic Result
--   </pre>
--   
--   These deriving statements above tie together the responses and the
--   return values, and the order in which they are defined matters. For
--   instance, if <tt>Even</tt> and <tt>Odd</tt> had switched places in the
--   definition of <tt>Result</tt>, this would provoke an error:
--   
--   <pre>
--   • No instance for ‘AsConstructor
--       ((:) @Type Int ('[] @Type)) (Respond 200 "Even number" Bool)’
--           arising from the 'deriving' clause of a data type declaration
--   </pre>
--   
--   If you would prefer to write an intance of <a>AsUnion</a> by yourself,
--   read more in the typeclass' documentation.
--   
--   Finally, let us write our endpoint description:
--   
--   <pre>
--   type MultipleChoicesInt =
--     Capture "int" Int
--     :&gt; MultiVerb
--       'GET
--       '[JSON]
--       Responses
--       Result
--   </pre>
data MultiVerb (method :: StdMethod) (requestMimeTypes :: k) (as :: [Type]) responses

-- | A <a>MultiVerb</a> endpoint with a single response. Ideal to ensure
--   that there can only be one response.
type MultiVerb1 (method :: StdMethod) (requestMimeTypes :: k) a = MultiVerb method requestMimeTypes '[a] ResponseType a

-- | A type to describe a <a>MultiVerb</a> response.
--   
--   Includes status code, description, and return type. The content type
--   of the response is determined dynamically using the accept header and
--   the list of supported content types specified in the containing
--   <a>MultiVerb</a> type.
data Respond (s :: Nat) (description :: Symbol) a

-- | A type to describe a <a>MultiVerb</a> response with a fixed content
--   type.
--   
--   Similar to <a>Respond</a>, but hardcodes the content type to be used
--   for generating the response. This content type is distinct from the
--   one given to <a>MultiVerb</a>, as it dictactes the response's content
--   type, not the content type request that is to be accepted.
data RespondAs (responseContentType :: k) (s :: Nat) (description :: Symbol) a

-- | A type to describe a <a>MultiVerb</a> response with an empty body.
--   
--   Includes status code and description.
type RespondEmpty (s :: Nat) (description :: Symbol) = RespondAs '() s description ()

-- | A type to describe a streaming <a>MultiVerb</a> response.
--   
--   Includes status code, description, framing strategy and content type.
--   Note that the handler return type is hardcoded to be 'SourceIO
--   ByteString'.
data RespondStreaming (s :: Nat) (description :: Symbol) framing ct

-- | This type adds response headers to a <a>MultiVerb</a> response.
data WithHeaders (headers :: [Type]) returnType response
data DescHeader (name :: Symbol) (description :: Symbol) a

-- | A wrapper to turn a response header into an optional one.
data OptHeader (h :: k)

-- | This is used to convert a response containing headers to a custom type
--   including the information in the headers.
--   
--   If you need to send a combination of headers and response that is not
--   provided by Servant, you can cwrite your own instance. Take example on
--   the ones provided.
class AsHeaders (headers :: [Type]) response returnType
fromHeaders :: AsHeaders headers response returnType => (NP I headers, response) -> returnType
toHeaders :: AsHeaders headers response returnType => returnType -> (NP I headers, response)
class ServantHeaders (headers :: k) (xs :: [Type]) | headers -> xs
constructHeaders :: ServantHeaders headers xs => NP I xs -> [Header]
extractHeaders :: ServantHeaders headers xs => Seq Header -> Maybe (NP I xs)
class ServantHeader (h :: k) (name :: Symbol) x | h -> name x
constructHeader :: ServantHeader h name x => x -> [Header]

-- | This class is used to convert a handler return type to a union type
--   including all possible responses of a <a>MultiVerb</a> endpoint.
--   
--   Any glue code necessary to convert application types to and from the
--   canonical <a>Union</a> type corresponding to a <a>MultiVerb</a>
--   endpoint should be packaged into an <a>AsUnion</a> instance.
--   
--   <h4><b>Example</b></h4>
--   
--   Let us take the example endpoint from the <a>MultiVerb</a>
--   documentation. There, we derived the <a>AsUnion</a> instance with the
--   help of Generics. The manual way of implementing the instance is:
--   
--   <pre>
--   instance AsUnion Responses Result where
--     toUnion NegativeNumber = Z (I ())
--     toUnion (Even b) = S (Z (I b))
--     toUnion (Odd i) = S (S (Z (I i)))
--   
--     fromUnion       (Z (I ())) = NegativeNumber
--     fromUnion    (S (Z (I b))) = Even b
--     fromUnion (S (S (Z (I i)))) = Odd i
--     fromUnion (S (S (S x))) = case x of {}
--   </pre>
--   
--   The last <a>fromUnion</a> equation is here to please the pattern
--   checker.
class AsUnion (as :: [Type]) r
toUnion :: AsUnion as r => r -> Union (ResponseTypes as)
fromUnion :: AsUnion as r => Union (ResponseTypes as) -> r
eitherToUnion :: forall (as :: [Type]) (bs :: [Type]) a b. (InjectAfter as bs, InjectBefore as bs) => (a -> Union as) -> (b -> Union bs) -> Either a b -> Union (as .++ bs)
eitherFromUnion :: EitherFromUnion as bs => (Union as -> a) -> (Union bs -> b) -> Union (as .++ bs) -> Either a b
maybeToUnion :: forall (as :: [Type]) a. (InjectAfter as '[()], InjectBefore as '[()]) => (a -> Union as) -> Maybe a -> Union (as .++ '[()])
maybeFromUnion :: forall (as :: [Type]) a. EitherFromUnion as '[()] => (Union as -> a) -> Union (as .++ '[()]) -> Maybe a

-- | This class can be instantiated to get automatic derivation of
--   <a>AsUnion</a> instances via <a>GenericAsUnion</a>. The idea is that
--   one has to make sure that for each response <tt>r</tt> in a
--   <a>MultiVerb</a> endpoint, there is an instance of <tt>AsConstructor
--   xs r</tt> for some <tt>xs</tt>, and that the list <tt>xss</tt> of all
--   the corresponding <tt>xs</tt> is equal to <a>Code</a> of the handler
--   type. Then one can write: @ type Responses = ... data Result = ...
--   deriving stock (Generic) deriving (AsUnion Responses) via
--   (GenericAsUnion Responses Result)
--   
--   instance GSOP.Generic Result @ and get an <a>AsUnion</a> instance for
--   free.
--   
--   There are a few predefined instances for constructors taking a single
--   type corresponding to a simple response, and for empty responses, but
--   in more general cases one either has to define an <a>AsConstructor</a>
--   instance by hand, or derive it via <a>GenericAsConstructor</a>.
class AsConstructor (xs :: [Type]) r
toConstructor :: AsConstructor xs r => ResponseType r -> NP I xs
fromConstructor :: AsConstructor xs r => NP I xs -> ResponseType r
newtype GenericAsConstructor r
GenericAsConstructor :: r -> GenericAsConstructor r

-- | This type is meant to be used with <tt>deriving via</tt> in order to
--   automatically generate an <a>AsUnion</a> instance using <a>SOP</a>.
--   
--   See <a>AsConstructor</a> for more information and examples.
newtype GenericAsUnion (rs :: k) a
GenericAsUnion :: a -> GenericAsUnion (rs :: k) a
type family ResponseType a
type family ResponseTypes (as :: [Type]) :: [Type]

-- | The result of parsing a response as a union alternative of type
--   <tt>a</tt>.
--   
--   <a>StatusMismatch</a> indicates that the response does not refer to
--   the given alternative, because the status code does not match the one
--   produced by that alternative.
--   
--   <a>UnrenderError</a> and <a>UnrenderSuccess</a> represent respectively
--   a failing and successful parse of the response body as a value of type
--   <tt>a</tt>.
--   
--   The <a>UnrenderResult</a> type constructor has monad and alternative
--   instances corresponding to those of 'Either (Maybe (Last String)) a'.
data UnrenderResult a
StatusMismatch :: UnrenderResult a
UnrenderError :: String -> UnrenderResult a
UnrenderSuccess :: a -> UnrenderResult a
instance GHC.Internal.Base.Alternative Servant.API.MultiVerb.UnrenderResult
instance GHC.Internal.Base.Applicative Servant.API.MultiVerb.UnrenderResult
instance (Servant.API.MultiVerb.AsConstructor xs r, Servant.API.MultiVerb.AsConstructors xss rs) => Servant.API.MultiVerb.AsConstructors (xs : xss) (r : rs)
instance Servant.API.MultiVerb.AsConstructors '[] '[]
instance Servant.API.MultiVerb.AsConstructor '[a] (Servant.API.MultiVerb.Respond code description a)
instance Servant.API.MultiVerb.AsConstructor '[a] (Servant.API.MultiVerb.RespondAs responseContentTypes code description a)
instance Servant.API.MultiVerb.AsConstructor '[a] (Servant.API.MultiVerb.WithHeaders headers a response)
instance Servant.API.MultiVerb.AsConstructor '[] (Servant.API.MultiVerb.RespondEmpty code description)
instance (Generics.SOP.Universe.Code (Servant.API.MultiVerb.ResponseType r) GHC.Types.~ '[xs], Generics.SOP.Universe.Generic (Servant.API.MultiVerb.ResponseType r)) => Servant.API.MultiVerb.AsConstructor xs (Servant.API.MultiVerb.GenericAsConstructor r)
instance Servant.API.MultiVerb.AsHeaders '[a, b] () (a, b)
instance Servant.API.MultiVerb.AsHeaders '[a] () a
instance Servant.API.MultiVerb.AsHeaders '[h] a (a, h)
instance Servant.API.MultiVerb.AsUnion '[Servant.API.MultiVerb.RespondEmpty s1 desc1, Servant.API.MultiVerb.RespondEmpty s2 desc2] GHC.Types.Bool
instance (Servant.API.MultiVerb.ResponseType r1 GHC.Types.~ (), Servant.API.MultiVerb.ResponseType r2 GHC.Types.~ a) => Servant.API.MultiVerb.AsUnion '[r1, r2] (GHC.Internal.Maybe.Maybe a)
instance (Servant.API.MultiVerb.ResponseType r GHC.Types.~ a) => Servant.API.MultiVerb.AsUnion '[r] a
instance (rs GHC.Types.~ Servant.API.MultiVerb.ResponseTypes as) => Servant.API.MultiVerb.AsUnion as (Servant.API.UVerb.Union.Union rs)
instance (Generics.SOP.Universe.Code a GHC.Types.~ xss, Generics.SOP.Universe.Generic a, Servant.API.MultiVerb.AsConstructors xss rs) => Servant.API.MultiVerb.AsUnion rs (Servant.API.MultiVerb.GenericAsUnion rs a)
instance Servant.API.MultiVerb.EitherFromUnion as bs => Servant.API.MultiVerb.EitherFromUnion (a : as) bs
instance Servant.API.MultiVerb.EitherFromUnion '[] bs
instance GHC.Classes.Eq a => GHC.Classes.Eq (Servant.API.MultiVerb.UnrenderResult a)
instance GHC.Internal.Base.Functor Servant.API.MultiVerb.UnrenderResult
instance Servant.API.MultiVerb.InjectAfter as bs => Servant.API.MultiVerb.InjectAfter (a : as) bs
instance Servant.API.MultiVerb.InjectAfter '[] bs
instance Servant.API.MultiVerb.InjectBefore as bs => Servant.API.MultiVerb.InjectBefore (a : as) bs
instance Servant.API.MultiVerb.InjectBefore '[] bs
instance GHC.Internal.Base.MonadPlus Servant.API.MultiVerb.UnrenderResult
instance GHC.Internal.Base.Monad Servant.API.MultiVerb.UnrenderResult
instance (GHC.Internal.TypeLits.KnownSymbol name, Web.Internal.HttpApiData.ToHttpApiData x) => Servant.API.MultiVerb.ServantHeader (Servant.API.MultiVerb.DescHeader name description x) name x
instance (GHC.Internal.TypeLits.KnownSymbol name, Web.Internal.HttpApiData.ToHttpApiData x) => Servant.API.MultiVerb.ServantHeader (Servant.API.Header.Header' mods name x) name x
instance forall k (h :: k) (name :: GHC.Types.Symbol) x. Servant.API.MultiVerb.ServantHeader h name x => Servant.API.MultiVerb.ServantHeader (Servant.API.MultiVerb.OptHeader h) name (GHC.Internal.Maybe.Maybe x)
instance forall a (name :: GHC.Types.Symbol) (h :: a) x (headers :: [a]) (xs :: [GHC.Types.Type]). (GHC.Internal.TypeLits.KnownSymbol name, Servant.API.MultiVerb.ServantHeader h name x, Web.Internal.HttpApiData.FromHttpApiData x, Servant.API.MultiVerb.ServantHeaders headers xs) => Servant.API.MultiVerb.ServantHeaders (h : headers) (x : xs)
instance Servant.API.MultiVerb.ServantHeaders '[] '[]
instance GHC.Internal.Show.Show a => GHC.Internal.Show.Show (Servant.API.MultiVerb.UnrenderResult a)


-- | Type safe generation of internal links.
--   
--   Given an API with a few endpoints:
--   
--   <pre>
--   &gt;&gt;&gt; :set -XDataKinds -XTypeFamilies -XTypeOperators -XPolyKinds
--   
--   &gt;&gt;&gt; import Servant.API
--   
--   &gt;&gt;&gt; import Servant.Links
--   
--   &gt;&gt;&gt; import Web.HttpApiData (toUrlPiece)
--   
--   &gt;&gt;&gt; import Data.Proxy
--   
--   &gt;&gt;&gt; 
--   
--   &gt;&gt;&gt; type Hello = "hello" :&gt; Get '[JSON] Int
--   
--   &gt;&gt;&gt; type Bye   = "bye"   :&gt; QueryParam "name" String :&gt; Delete '[JSON] NoContent
--   
--   &gt;&gt;&gt; type API   = Hello :&lt;|&gt; Bye
--   
--   &gt;&gt;&gt; let api = Proxy :: Proxy API
--   </pre>
--   
--   It is possible to generate links that are guaranteed to be within
--   <tt>API</tt> with <a>safeLink</a>. The first argument to
--   <a>safeLink</a> is a type representing the API you would like to
--   restrict links to. The second argument is the destination endpoint you
--   would like the link to point to, this will need to end with a verb
--   like GET or POST. Further arguments may be required depending on the
--   type of the endpoint. If everything lines up you will get a
--   <a>Link</a> out the other end.
--   
--   You may omit <tt>QueryParam</tt>s and the like should you not want to
--   provide them, but types which form part of the URL path like
--   <tt>Capture</tt> must be included. The reason you may want to omit
--   <tt>QueryParam</tt>s is that safeLink is a bit magical: if parameters
--   are included that could take input it will return a function that
--   accepts that input and generates a link. This is best shown with an
--   example. Here, a link is generated with no parameters:
--   
--   <pre>
--   &gt;&gt;&gt; let hello = Proxy :: Proxy ("hello" :&gt; Get '[JSON] Int)
--   
--   &gt;&gt;&gt; toUrlPiece (safeLink api hello :: Link)
--   "hello"
--   </pre>
--   
--   If the API has an endpoint with parameters then we can generate links
--   with or without those:
--   
--   <pre>
--   &gt;&gt;&gt; let with = Proxy :: Proxy ("bye" :&gt; QueryParam "name" String :&gt; Delete '[JSON] NoContent)
--   
--   &gt;&gt;&gt; toUrlPiece $ safeLink api with (Just "Hubert")
--   "bye?name=Hubert"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; let without = Proxy :: Proxy ("bye" :&gt; Delete '[JSON] NoContent)
--   
--   &gt;&gt;&gt; toUrlPiece $ safeLink api without
--   "bye"
--   </pre>
--   
--   If you would like to create a helper for generating links only within
--   that API, you can partially apply safeLink if you specify a correct
--   type signature like so:
--   
--   <pre>
--   &gt;&gt;&gt; :set -XConstraintKinds
--   
--   &gt;&gt;&gt; :{
--   
--   &gt;&gt;&gt; let apiLink :: (IsElem endpoint API, HasLink endpoint)
--   
--   &gt;&gt;&gt; =&gt; Proxy endpoint -&gt; MkLink endpoint Link
--   
--   &gt;&gt;&gt; apiLink = safeLink api
--   
--   &gt;&gt;&gt; :}
--   </pre>
--   
--   <a>safeLink'</a> allows you to specialise the output:
--   
--   <pre>
--   &gt;&gt;&gt; safeLink' toUrlPiece api without
--   "bye"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; :{
--   
--   &gt;&gt;&gt; let apiTextLink :: (IsElem endpoint API, HasLink endpoint)
--   
--   &gt;&gt;&gt; =&gt; Proxy endpoint -&gt; MkLink endpoint Text
--   
--   &gt;&gt;&gt; apiTextLink = safeLink' toUrlPiece api
--   
--   &gt;&gt;&gt; :}
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; apiTextLink without
--   "bye"
--   </pre>
--   
--   Attempting to construct a link to an endpoint that does not exist in
--   api will result in a type error like this:
--   
--   <pre>
--   &gt;&gt;&gt; let bad_link = Proxy :: Proxy ("hello" :&gt; Delete '[JSON] NoContent)
--   
--   &gt;&gt;&gt; safeLink api bad_link
--   ...
--   ...Could not ...
--   ...
--   </pre>
--   
--   This error is essentially saying that the type family couldn't find
--   bad_link under api after trying the open (but empty) type family
--   <a>IsElem'</a> as a last resort.
module Servant.Links

-- | Create a valid (by construction) relative URI with query params.
--   
--   This function will only typecheck if <tt>endpoint</tt> is part of the
--   API <tt>api</tt>
safeLink :: (IsElem endpoint api, HasLink endpoint) => Proxy api -> Proxy endpoint -> MkLink endpoint Link

-- | More general <a>safeLink</a>.
safeLink' :: (IsElem endpoint api, HasLink endpoint) => (Link -> a) -> Proxy api -> Proxy endpoint -> MkLink endpoint a

-- | Create all links in an API.
--   
--   Note that the <tt>api</tt> type must be restricted to the endpoints
--   that have valid links to them.
--   
--   <pre>
--   &gt;&gt;&gt; type API = "foo" :&gt; Capture "name" Text :&gt; Get '[JSON] Text :&lt;|&gt; "bar" :&gt; Capture "name" Int :&gt; Get '[JSON] Double
--   
--   &gt;&gt;&gt; let fooLink :&lt;|&gt; barLink = allLinks (Proxy :: Proxy API)
--   
--   &gt;&gt;&gt; :t fooLink
--   fooLink :: Text -&gt; Link
--   
--   &gt;&gt;&gt; :t barLink
--   barLink :: Int -&gt; Link
--   </pre>
--   
--   Note: nested APIs don't work well with this approach
--   
--   <pre>
--   &gt;&gt;&gt; :kind! MkLink (Capture "nest" Char :&gt; (Capture "x" Int :&gt; Get '[JSON] Int :&lt;|&gt; Capture "y" Double :&gt; Get '[JSON] Double)) Link
--   MkLink (Capture "nest" Char :&gt; (Capture "x" Int :&gt; Get '[JSON] Int :&lt;|&gt; Capture "y" Double :&gt; Get '[JSON] Double)) Link :: Type
--   = Char -&gt; (Int -&gt; Link) :&lt;|&gt; (Double -&gt; Link)
--   </pre>
allLinks :: forall {k} (api :: k). HasLink api => Proxy api -> MkLink api Link

-- | More general <a>allLinks</a>. See <a>safeLink'</a>.
allLinks' :: forall {k} (api :: k) a. HasLink api => (Link -> a) -> Proxy api -> MkLink api a
data URI
URI :: String -> Maybe URIAuth -> String -> String -> String -> URI
[uriScheme] :: URI -> String
[uriAuthority] :: URI -> Maybe URIAuth
[uriPath] :: URI -> String
[uriQuery] :: URI -> String
[uriFragment] :: URI -> String

-- | A type that specifies that an API record contains a set of links.
data AsLink a

-- | Given an API record field, create a link for that route. Only the
--   field's type is used.
--   
--   <pre>
--   data Record route = Record
--       { _get :: route :- Capture "id" Int :&gt; Get '[JSON] String
--       , _put :: route :- ReqBody '[JSON] Int :&gt; Put '[JSON] Bool
--       }
--     deriving (<a>Generic</a>)
--   
--   getLink :: Int -&gt; Link
--   getLink = <a>fieldLink</a> _get
--   </pre>
fieldLink :: (IsElem endpoint (ToServantApi routes), HasLink endpoint, GenericServant routes AsApi) => (routes AsApi -> endpoint) -> MkLink endpoint Link

-- | More general version of <a>fieldLink</a>
fieldLink' :: forall routes endpoint a. (IsElem endpoint (ToServantApi routes), HasLink endpoint, GenericServant routes AsApi) => (Link -> a) -> (routes AsApi -> endpoint) -> MkLink endpoint a

-- | Get all links as a record.
allFieldLinks :: (HasLink (ToServantApi routes), GenericServant routes (AsLink Link), ToServant routes (AsLink Link) ~ MkLink (ToServantApi routes) Link) => routes (AsLink Link)

-- | More general version of <a>allFieldLinks</a>.
allFieldLinks' :: (HasLink (ToServantApi routes), GenericServant routes (AsLink a), ToServant routes (AsLink a) ~ MkLink (ToServantApi routes) a) => (Link -> a) -> routes (AsLink a)

-- | Construct a toLink for an endpoint.
class HasLink (endpoint :: k) where {
    type MkLink (endpoint :: k) a;
}
toLink :: HasLink endpoint => (Link -> a) -> Proxy endpoint -> Link -> MkLink endpoint a

-- | A safe link datatype. The only way of constructing a <a>Link</a> is
--   using <a>safeLink</a>, which means any <a>Link</a> is guaranteed to be
--   part of the mentioned API.
--   
--   NOTE: If you are writing a custom <a>HasLink</a> instance, and need to
--   manipulate the <a>Link</a> (adding query params or fragments,
--   perhaps), please use the the <a>addQueryParam</a> and
--   <a>addSegment</a> functions.
data Link

-- | Transform <a>Link</a> into <a>URI</a>.
--   
--   <pre>
--   &gt;&gt;&gt; type API = "something" :&gt; Get '[JSON] Int
--   
--   &gt;&gt;&gt; linkURI $ safeLink (Proxy :: Proxy API) (Proxy :: Proxy API)
--   something
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; type API = "sum" :&gt; QueryParams "x" Int :&gt; Get '[JSON] Int
--   
--   &gt;&gt;&gt; linkURI $ safeLink (Proxy :: Proxy API) (Proxy :: Proxy API) [1, 2, 3]
--   sum?x[]=1&amp;x[]=2&amp;x[]=3
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; type API = "foo/bar" :&gt; Get '[JSON] Int
--   
--   &gt;&gt;&gt; linkURI $ safeLink (Proxy :: Proxy API) (Proxy :: Proxy API)
--   foo%2Fbar
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; type SomeRoute = "abc" :&gt; Capture "email" String :&gt; Put '[JSON] ()
--   
--   &gt;&gt;&gt; let someRoute = Proxy :: Proxy SomeRoute
--   
--   &gt;&gt;&gt; safeLink someRoute someRoute "test@example.com"
--   Link {_segments = ["abc","test%40example.com"], _queryParams = [], _fragment = Nothing}
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; linkURI $ safeLink someRoute someRoute "test@example.com"
--   abc/test%40example.com
--   </pre>
linkURI :: Link -> URI

-- | Configurable <a>linkURI</a>.
--   
--   <pre>
--   &gt;&gt;&gt; type API = "sum" :&gt; QueryParams "x" Int :&gt; Get '[JSON] Int
--   
--   &gt;&gt;&gt; linkURI' LinkArrayElementBracket $ safeLink (Proxy :: Proxy API) (Proxy :: Proxy API) [1, 2, 3]
--   sum?x[]=1&amp;x[]=2&amp;x[]=3
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; linkURI' LinkArrayElementPlain $ safeLink (Proxy :: Proxy API) (Proxy :: Proxy API) [1, 2, 3]
--   sum?x=1&amp;x=2&amp;x=3
--   </pre>
linkURI' :: LinkArrayElementStyle -> Link -> URI

-- | How to encode array query elements.
data LinkArrayElementStyle

-- | <pre>
--   foo[]=1&amp;foo[]=2
--   </pre>
LinkArrayElementBracket :: LinkArrayElementStyle

-- | <pre>
--   foo=1&amp;foo=2
--   </pre>
LinkArrayElementPlain :: LinkArrayElementStyle

-- | Query parameter.
data Param
SingleParam :: String -> Text -> Param
ArrayElemParam :: String -> Text -> Param
FlagParam :: String -> Param
linkSegments :: Link -> [String]
linkQueryParams :: Link -> [Param]
linkFragment :: Link -> Fragment'

-- | Add a <a>Param</a> (query param) to a <a>Link</a>
--   
--   Please use this judiciously from within your custom <a>HasLink</a>
--   instances to ensure that you don't end-up breaking the safe provided
--   by "safe links"
addQueryParam :: Param -> Link -> Link
instance GHC.Internal.Enum.Bounded Servant.Links.LinkArrayElementStyle
instance GHC.Internal.Enum.Enum Servant.Links.LinkArrayElementStyle
instance GHC.Classes.Eq Servant.Links.LinkArrayElementStyle
instance Servant.Links.GLinkConstraints routes a => Servant.Links.GLink routes a
instance Servant.API.Generic.GenericMode (Servant.Links.AsLink a)
instance (Servant.Links.HasLink a, Servant.Links.HasLink b) => Servant.Links.HasLink (a Servant.API.Alternative.:<|> b)
instance Servant.Links.HasLink sub => Servant.Links.HasLink (Servant.API.Description.Summary s Servant.API.Sub.:> sub)
instance Servant.Links.HasLink sub => Servant.Links.HasLink (Network.HTTP.Types.Version.HttpVersion Servant.API.Sub.:> sub)
instance Servant.Links.HasLink sub => Servant.Links.HasLink (Servant.API.IsSecure.IsSecure Servant.API.Sub.:> sub)
instance forall k sub (res :: k). Servant.Links.HasLink sub => Servant.Links.HasLink (Servant.API.WithResource.WithResource res Servant.API.Sub.:> sub)
instance Servant.Links.HasLink sub => Servant.Links.HasLink (Servant.API.RemoteHost.RemoteHost Servant.API.Sub.:> sub)
instance Servant.Links.HasLink sub => Servant.Links.HasLink (Servant.API.BasicAuth.BasicAuth realm a Servant.API.Sub.:> sub)
instance forall k sub (tag :: k). Servant.Links.HasLink sub => Servant.Links.HasLink (Servant.API.Experimental.Auth.AuthProtect tag Servant.API.Sub.:> sub)
instance (GHC.Internal.TypeLits.KnownSymbol sym, Servant.Links.HasLink sub) => Servant.Links.HasLink (sym Servant.API.Sub.:> sub)
instance (Servant.Links.HasLink sub, Web.Internal.HttpApiData.ToHttpApiData v) => Servant.Links.HasLink (Servant.API.Fragment.Fragment v Servant.API.Sub.:> sub)
instance (GHC.Internal.TypeLits.KnownSymbol sym, Web.Internal.HttpApiData.ToHttpApiData v, Servant.Links.HasLink sub, Data.Singletons.Bool.SBoolI (Servant.API.Modifiers.FoldRequired mods)) => Servant.Links.HasLink (Servant.API.QueryParam.QueryParam' mods sym v Servant.API.Sub.:> sub)
instance (GHC.Internal.TypeLits.KnownSymbol sym, Web.Internal.HttpApiData.ToHttpApiData v, Servant.Links.HasLink sub) => Servant.Links.HasLink (Servant.API.QueryParam.QueryParams sym v Servant.API.Sub.:> sub)
instance (GHC.Internal.TypeLits.KnownSymbol sym, Servant.Links.HasLink sub) => Servant.Links.HasLink (Servant.API.QueryParam.QueryFlag sym Servant.API.Sub.:> sub)
instance Servant.Links.HasLink sub => Servant.Links.HasLink (Servant.API.ReqBody.ReqBody' mods ct a Servant.API.Sub.:> sub)
instance Servant.Links.HasLink sub => Servant.Links.HasLink (Servant.API.Stream.StreamBody' mods framing ct a Servant.API.Sub.:> sub)
instance (Web.Internal.HttpApiData.ToHttpApiData v, Servant.Links.HasLink sub) => Servant.Links.HasLink (Servant.API.Capture.Capture' mods sym v Servant.API.Sub.:> sub)
instance (Web.Internal.HttpApiData.ToHttpApiData v, Servant.Links.HasLink sub) => Servant.Links.HasLink (Servant.API.Capture.CaptureAll sym v Servant.API.Sub.:> sub)
instance Servant.Links.HasLink sub => Servant.Links.HasLink (Servant.API.Header.Header' mods sym a Servant.API.Sub.:> sub)
instance Servant.Links.HasLink sub => Servant.Links.HasLink (Data.Vault.Lazy.Vault Servant.API.Sub.:> sub)
instance Servant.Links.HasLink sub => Servant.Links.HasLink (Servant.API.Description.Description s Servant.API.Sub.:> sub)
instance forall a b (arr :: a -> b) sub. (TypeError ...) => Servant.Links.HasLink (arr Servant.API.Sub.:> sub)
instance forall k (ty :: k) sub. (TypeError ...) => Servant.Links.HasLink (ty Servant.API.Sub.:> sub)
instance (GHC.Internal.TypeLits.KnownSymbol sym, Servant.API.QueryString.ToDeepQuery record, Servant.Links.HasLink sub) => Servant.Links.HasLink (Servant.API.QueryString.DeepQuery sym record Servant.API.Sub.:> sub)
instance Servant.Links.HasLink Servant.API.Empty.EmptyAPI
instance forall k (method :: Network.HTTP.Types.Method.StdMethod) (cs :: k) (as :: [GHC.Types.Type]) r. Servant.Links.HasLink (Servant.API.MultiVerb.MultiVerb method cs as r)
instance (Servant.Links.HasLink (Servant.API.Generic.ToServantApi routes), forall a. Servant.Links.GLink routes a, Servant.API.TypeErrors.ErrorIfNoGeneric routes) => Servant.Links.HasLink (Servant.API.NamedRoutes.NamedRoutes routes)
instance forall k1 (m :: k1). Servant.Links.HasLink (Servant.API.Verbs.NoContentVerb m)
instance Servant.Links.HasLink Servant.API.Raw.Raw
instance Servant.Links.HasLink Servant.API.Raw.RawM
instance forall k1 (m :: k1) (status :: GHC.Internal.TypeNats.Nat) fr ct a. Servant.Links.HasLink (Servant.API.Stream.Stream m status fr ct a)
instance Servant.Links.HasLink (Servant.API.UVerb.UVerb m ct a)
instance forall k1 (m :: k1) (s :: GHC.Internal.TypeNats.Nat) (ct :: [GHC.Types.Type]) a. Servant.Links.HasLink (Servant.API.Verbs.Verb m s ct a)
instance forall k (sub :: k) (name :: GHC.Types.Symbol) (context :: [GHC.Types.Type]). Servant.Links.HasLink sub => Servant.Links.HasLink (Servant.API.WithNamedContext.WithNamedContext name context sub)
instance forall k (api :: k). (TypeError ...) => Servant.Links.HasLink api
instance GHC.Classes.Ord Servant.Links.LinkArrayElementStyle
instance GHC.Internal.Show.Show Servant.Links.Escaped
instance GHC.Internal.Show.Show Servant.Links.Link
instance GHC.Internal.Show.Show Servant.Links.LinkArrayElementStyle
instance GHC.Internal.Show.Show Servant.Links.Param
instance Web.Internal.HttpApiData.ToHttpApiData Servant.Links.Link

module Servant.API

-- | Leniently parsed argument, i.e. parsing never fail. Wrapped in
--   <tt><a>Either</a> <a>Text</a></tt>.
data Lenient

-- | Optional argument. Wrapped in <a>Maybe</a>.
data Optional

-- | Required argument. Not wrapped.
data Required

-- | Strictly parsed argument. Not wrapped.
data Strict

-- | Extract an deep object from a query string.
--   
--   Example:
--   
--   <pre>
--   &gt;&gt;&gt; -- /books?filter[author][name]=&lt;author name&gt;&amp;filter[year]=&lt;book year&gt;
--   
--   &gt;&gt;&gt; type MyApi = "books" :&gt; DeepQuery "filter" BookQuery :&gt; Get '[JSON] [Book]
--   </pre>
data DeepQuery (sym :: Symbol) a

-- | Extract the whole query string from a request. This is useful for
--   query strings containing dynamic parameter names. For query strings
--   with static parameter names, <tt>QueryParam</tt> is more suited.
--   
--   Example:
--   
--   <pre>
--   &gt;&gt;&gt; -- /books?author=&lt;author name&gt;&amp;year=&lt;book year&gt;
--   
--   &gt;&gt;&gt; type MyApi = "books" :&gt; QueryString :&gt; Get '[JSON] [Book]
--   </pre>
data QueryString
data StdMethod
GET :: StdMethod
POST :: StdMethod
HEAD :: StdMethod
PUT :: StdMethod
DELETE :: StdMethod
TRACE :: StdMethod
CONNECT :: StdMethod
OPTIONS :: StdMethod
PATCH :: StdMethod

-- | <a>DELETE</a> with 200 status code.
type Delete = Verb 'DELETE 200

-- | <a>DELETE</a> with 202 status code.
type DeleteAccepted = Verb 'DELETE 202

-- | <a>DELETE</a> with 204 status code.
type DeleteNoContent = NoContentVerb 'DELETE

-- | <a>DELETE</a> with 203 status code.
type DeleteNonAuthoritative = Verb 'DELETE 203

-- | <a>GET</a> with 200 status code.
type Get = Verb 'GET 200

-- | <a>GET</a> with 202 status code.
type GetAccepted = Verb 'GET 202

-- | <a>GET</a> with 204 status code.
type GetNoContent = NoContentVerb 'GET

-- | <a>GET</a> with 203 status code.
type GetNonAuthoritative = Verb 'GET 203

-- | <a>GET</a> with 206 status code.
type GetPartialContent = Verb 'GET 206

-- | <a>GET</a> with 205 status code.
type GetResetContent = Verb 'GET 205

-- | <tt>NoContentVerb</tt> is a specific type to represent
--   <tt>NoContent</tt> responses. It does not require either a list of
--   content types (because there's no content) or a status code (because
--   it should always be 204).
data NoContentVerb (method :: k1)

-- | <a>PATCH</a> with 200 status code.
type Patch = Verb 'PATCH 200

-- | <a>PATCH</a> with 202 status code.
type PatchAccepted = Verb 'PATCH 202

-- | <a>PATCH</a> with 204 status code.
type PatchNoContent = NoContentVerb 'PATCH

-- | <a>PATCH</a> with 203 status code.
type PatchNonAuthoritative = Verb 'PATCH 203

-- | <a>POST</a> with 200 status code.
type Post = Verb 'POST 200

-- | <a>POST</a> with 202 status code.
type PostAccepted = Verb 'POST 202

-- | <a>POST</a> with 201 status code.
type PostCreated = Verb 'POST 201

-- | <a>POST</a> with 204 status code.
type PostNoContent = NoContentVerb 'POST

-- | <a>POST</a> with 203 status code.
type PostNonAuthoritative = Verb 'POST 203

-- | <a>POST</a> with 205 status code.
type PostResetContent = Verb 'POST 205

-- | <a>PUT</a> with 200 status code.
type Put = Verb 'PUT 200

-- | <a>PUT</a> with 202 status code.
type PutAccepted = Verb 'PUT 202

-- | <a>PUT</a> with 201 status code.
type PutCreated = Verb 'PUT 201

-- | <a>PUT</a> with 204 status code.
type PutNoContent = NoContentVerb 'PUT

-- | <a>PUT</a> with 203 status code.
type PutNonAuthoritative = Verb 'PUT 203
class ReflectMethod (a :: k)
reflectMethod :: ReflectMethod a => Proxy a -> Method

-- | <tt>Verb</tt> is a general type for representing HTTP verbs (a.k.a.
--   methods). For convenience, type synonyms for each verb with a 200
--   response code are provided, but you are free to define your own:
--   
--   <pre>
--   &gt;&gt;&gt; type Post204 contentTypes a = Verb 'POST 204 contentTypes a
--   </pre>
data Verb (method :: k1) (statusCode :: Nat) (contentTypes :: [Type]) a
statusOf :: HasStatus a => proxy a -> Status
class KnownStatus StatusOf a => HasStatus a where {
    type StatusOf a :: Nat;
}
type family Statuses (as :: [Type]) :: [Nat]
type family StatusOf a :: Nat
type family Statuses (as :: [Type]) :: [Nat]

-- | A variant of <tt>Verb</tt> that can have any of a number of response
--   values and status codes.
--   
--   FUTUREWORK: it would be nice to make <tt>Verb</tt> a special case of
--   <a>UVerb</a>, and only write instances for <tt>HasServer</tt> etc. for
--   the latter, getting them for the former for free. Something like:
--   
--   <pre>
--   type Verb method statusCode contentTypes a = UVerb method contentTypes [WithStatus statusCode a]
--   </pre>
--   
--   Backwards compatibility is tricky, though: this type alias would mean
--   people would have to use <tt>respond</tt> instead of <a>pure</a> or
--   <a>return</a>, so all old handlers would have to be rewritten.
data UVerb (method :: StdMethod) (contentTypes :: [Type]) (as :: [Type])

-- | A simple newtype wrapper that pairs a type with its status code. It
--   implements all the content types that Servant ships with by default.
newtype WithStatus (k :: Nat) a
WithStatus :: a -> WithStatus (k :: Nat) a
type IsMember (a :: u) (as :: [u]) = (Unique as, CheckElemIsMember a as, UElem a as)
inject :: UElem x xs => f x -> NS f xs
type Union = NS I

-- | Check whether all values in a type-level list are distinct. This will
--   throw a nice error if there are any duplicate elements in the list.
type family Unique (xs :: [k])

-- | Inverse of <a>toServant</a>.
--   
--   This can be used to turn <tt>generated</tt> values such as client
--   functions into records.
--   
--   You may need to provide a type signature for the <i>output</i> type
--   (your record type).
fromServant :: forall {k} routes (mode :: k). GenericServant routes mode => ToServant routes mode -> routes mode

-- | Get a <a>Proxy</a> of an API type.
genericApi :: forall (routes :: Type -> Type). GenericServant routes AsApi => Proxy routes -> Proxy (ToServantApi routes)

-- | See <a>ToServant</a>, but at value-level.
toServant :: forall {k} routes (mode :: k). GenericServant routes mode => routes mode -> ToServant routes mode
type family (mode :: k) :- api
infixl 0 :-

-- | A type that specifies that an API record contains an API definition.
--   Only useful at type-level.
data AsApi
class GServantProduct (f :: k -> Type)

-- | A class with a type family that applies an appropriate type family to
--   the <tt>api</tt> parameter. For example, <a>AsApi</a> will leave
--   <tt>api</tt> untouched, while <tt><tt>AsServerT</tt> m</tt> will
--   produce <tt><tt>ServerT</tt> api m</tt>.
class GenericMode (mode :: k) where {
    type (mode :: k) :- api;
}
infixl 0 :-

-- | A constraint alias, for work with <tt>mode</tt> and <tt>routes</tt>.
type GenericServant (routes :: k -> Type) (mode :: k) = (GenericMode mode, Generic routes mode, GServantProduct Rep routes mode)

-- | Turns a generic product type into a tree of <a>:&lt;|&gt;</a>
--   combinators.
type ToServant (routes :: k -> Type) (mode :: k) = GToServant Rep routes mode
type ToServantApi (routes :: Type -> Type) = ToServant routes AsApi

-- | The <a>FramingRender</a> class provides the logic for emitting a
--   framing strategy. The strategy transforms a <tt><a>SourceT</a> m
--   a</tt> into <tt><a>SourceT</a> m <a>ByteString</a></tt>, therefore it
--   can prepend, append and intercalate <i>framing</i> structure around
--   chunks.
--   
--   <i>Note:</i> as the <tt><a>Monad</a> m</tt> is generic, this is pure
--   transformation.
class FramingRender (strategy :: k)
framingRender :: forall (m :: Type -> Type) a. (FramingRender strategy, Monad m) => Proxy strategy -> (a -> ByteString) -> SourceT m a -> SourceT m ByteString

-- | The <a>FramingUnrender</a> class provides the logic for parsing a
--   framing strategy.
class FramingUnrender (strategy :: k)
framingUnrender :: forall (m :: Type -> Type) a. (FramingUnrender strategy, Monad m) => Proxy strategy -> (ByteString -> Either String a) -> SourceT m ByteString -> SourceT m a

-- | <a>FromSourceIO</a> is intended to be implemented for types such as
--   Conduit, Pipe, etc. By implementing this class, all such streaming
--   abstractions can be used directly on the client side for talking to
--   streaming endpoints.
class FromSourceIO chunk a | a -> chunk
fromSourceIO :: FromSourceIO chunk a => SourceIO chunk -> IO a

-- | The netstring framing strategy as defined by djb:
--   <a>http://cr.yp.to/proto/netstrings.txt</a>
--   
--   Any string of 8-bit bytes may be encoded as
--   <tt>[len]":"[string]","</tt>. Here <tt>[string]</tt> is the string and
--   <tt>[len]</tt> is a nonempty sequence of ASCII digits giving the
--   length of <tt>[string]</tt> in decimal. The ASCII digits are
--   <tt><a>30</a></tt> for 0, <tt><a>31</a></tt> for 1, and so on up
--   through <tt><a>39</a></tt> for 9. Extra zeros at the front of
--   <tt>[len]</tt> are prohibited: <tt>[len]</tt> begins with
--   <tt><a>30</a></tt> exactly when <tt>[string]</tt> is empty.
--   
--   For example, the string <tt>"hello world!"</tt> is encoded as
--   <tt><a>32 3a 68 65 6c 6c 6f 20 77 6f 72 6c 64 21 2c</a></tt>, i.e.,
--   <tt>"12:hello world!,"</tt>. The empty string is encoded as
--   <tt>"0:,"</tt>.
data NetstringFraming

-- | A simple framing strategy that has no header, and inserts a newline
--   character after each frame. This assumes that it is used with a
--   Content-Type that encodes without newlines (e.g. JSON).
data NewlineFraming

-- | A framing strategy that does not do any framing at all, it just passes
--   the input data This will be used most of the time with binary data,
--   such as files
data NoFraming

-- | Stream endpoints may be implemented as producing a <tt><a>SourceIO</a>
--   chunk</tt>.
--   
--   Clients reading from streaming endpoints can be implemented as
--   consuming a <tt><a>SourceIO</a> chunk</tt>.
type SourceIO = SourceT IO

-- | A Stream endpoint for a given method emits a stream of encoded values
--   at a given <tt>Content-Type</tt>, delimited by a <tt>framing</tt>
--   strategy. Type synonyms are provided for standard methods.
data Stream (method :: k1) (status :: Nat) framing contentType a

-- | A stream request body.
type StreamBody = StreamBody' '[] :: [Type]
data StreamBody' (mods :: [Type]) framing contentType a
type StreamGet = Stream 'GET 200
type StreamPost = Stream 'POST 200

-- | <a>ToSourceIO</a> is intended to be implemented for types such as
--   Conduit, Pipe, etc. By implementing this class, all such streaming
--   abstractions can be used directly as endpoints.
class ToSourceIO chunk a | a -> chunk
toSourceIO :: ToSourceIO chunk a => a -> SourceIO chunk

-- | Add more verbose description for (part of) API.
--   
--   Example:
--   
--   <pre>
--   &gt;&gt;&gt; :{
--   type MyApi = Description
--    "This comment is visible in multiple Servant interpretations \
--    \and can be really long if necessary. \
--    \Haskell multiline String support is not perfect \
--    \but it's still very readable."
--   :&gt; Get '[JSON] Book
--   :}
--   </pre>
data Description (sym :: Symbol)

-- | Add a short summary for (part of) API.
--   
--   Example:
--   
--   <pre>
--   &gt;&gt;&gt; type MyApi = Summary "Get book by ISBN." :&gt; "books" :&gt; Capture "isbn" Text :&gt; Get '[JSON] Book
--   </pre>
data Summary (sym :: Symbol)

-- | Instances of <a>Accept</a> represent mimetypes. They are used for
--   matching against the <tt>Accept</tt> HTTP header of the request, and
--   for setting the <tt>Content-Type</tt> header of the response
--   
--   Example:
--   
--   <pre>
--   &gt;&gt;&gt; import Network.HTTP.Media ((//), (/:))
--   
--   &gt;&gt;&gt; data HTML
--   
--   &gt;&gt;&gt; :{
--   instance Accept HTML where
--      contentType _ = "text" // "html" /: ("charset", "utf-8")
--   :}
--   </pre>
class Accept (ctype :: k)
contentType :: Accept ctype => Proxy ctype -> MediaType
contentTypes :: Accept ctype => Proxy ctype -> NonEmpty MediaType
data FormUrlEncoded
data JSON

-- | Instantiate this class to register a way of serializing a type based
--   on the <tt>Accept</tt> header.
--   
--   Example:
--   
--   <pre>
--   data MyContentType
--   
--   instance Accept MyContentType where
--      contentType _ = "example" // "prs.me.mine" /: ("charset", "utf-8")
--   
--   instance Show a =&gt; MimeRender MyContentType a where
--      mimeRender _ val = pack ("This is MINE! " ++ show val)
--   
--   type MyAPI = "path" :&gt; Get '[MyContentType] Int
--   </pre>
class Accept ctype => MimeRender (ctype :: k) a
mimeRender :: MimeRender ctype a => Proxy ctype -> a -> ByteString

-- | Instantiate this class to register a way of deserializing a type based
--   on the request's <tt>Content-Type</tt> header.
--   
--   <pre>
--   &gt;&gt;&gt; import Network.HTTP.Media hiding (Accept)
--   
--   &gt;&gt;&gt; import qualified Data.ByteString.Lazy.Char8 as BSC
--   
--   &gt;&gt;&gt; data MyContentType = MyContentType String
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; :{
--   instance Accept MyContentType where
--      contentType _ = "example" // "prs.me.mine" /: ("charset", "utf-8")
--   :}
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; :{
--   instance Read a =&gt; MimeUnrender MyContentType a where
--      mimeUnrender _ bs = case BSC.take 12 bs of
--        "MyContentType" -&gt; return . read . BSC.unpack $ BSC.drop 12 bs
--        _ -&gt; Left "didn't start with the magic incantation"
--   :}
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; type MyAPI = "path" :&gt; ReqBody '[MyContentType] Int :&gt; Get '[JSON] Int
--   </pre>
class Accept ctype => MimeUnrender (ctype :: k) a
mimeUnrender :: MimeUnrender ctype a => Proxy ctype -> ByteString -> Either String a

-- | Variant which is given the actual <a>MediaType</a> provided by the
--   other party.
--   
--   In the most cases you don't want to branch based on the
--   <a>MediaType</a>. See <a>pr552</a> for a motivating example.
mimeUnrenderWithType :: MimeUnrender ctype a => Proxy ctype -> MediaType -> ByteString -> Either String a

-- | A type for responses without content-body.
data NoContent
NoContent :: NoContent
data OctetStream
data PlainText

-- | <tt>addHeader</tt> adds a header to a response. Note that it changes
--   the type of the value in the following ways:
--   
--   <ol>
--   <li>A simple value is wrapped in "Headers '[hdr]":</li>
--   </ol>
--   
--   <pre>
--   &gt;&gt;&gt; let example0 = addHeader 5 "hi" :: Headers '[Header "someheader" Int] String;
--   
--   &gt;&gt;&gt; getHeaders example0
--   [("someheader","5")]
--   </pre>
--   
--   <ol>
--   <li>A value that already has a header has its new header *prepended*
--   to the existing list:</li>
--   </ol>
--   
--   <pre>
--   &gt;&gt;&gt; let example1 = addHeader 5 "hi" :: Headers '[Header "someheader" Int] String;
--   
--   &gt;&gt;&gt; let example2 = addHeader True example1 :: Headers '[Header "1st" Bool, Header "someheader" Int] String
--   
--   &gt;&gt;&gt; getHeaders example2
--   [("1st","true"),("someheader","5")]
--   </pre>
--   
--   Note that while in your handlers type annotations are not required,
--   since the type can be inferred from the API type, in other cases you
--   may find yourself needing to add annotations.
addHeader :: forall (h :: Symbol) v orig new. AddHeader '[Optional, Strict] h v orig new => v -> orig -> new

-- | Same as <a>addHeader</a> but works with <a>Header'</a>, so it's
--   possible to use any <tt>mods</tt>.
addHeader' :: forall (mods :: [Type]) (h :: Symbol) v orig new. AddHeader mods h v orig new => v -> orig -> new

-- | Look up a specific ResponseHeader, without having to know what
--   position it is in the HList.
--   
--   <pre>
--   &gt;&gt;&gt; let example1 = addHeader 5 "hi" :: Headers '[Header "someheader" Int] String
--   
--   &gt;&gt;&gt; let example2 = addHeader True example1 :: Headers '[Header "1st" Bool, Header "someheader" Int] String
--   
--   &gt;&gt;&gt; lookupResponseHeader example2 :: ResponseHeader "someheader" Int
--   Header 5
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; lookupResponseHeader example2 :: ResponseHeader "1st" Bool
--   Header True
--   </pre>
--   
--   Usage of this function relies on an explicit type annotation of the
--   header to be looked up. This can be done with type annotations on the
--   result, or with an explicit type application. In this example, the
--   type of header value is determined by the type-inference, we only
--   specify the name of the header:
--   
--   <pre>
--   &gt;&gt;&gt; :set -XTypeApplications
--   
--   &gt;&gt;&gt; case lookupResponseHeader @"1st" example2 of { Header b -&gt; b ; _ -&gt; False }
--   True
--   </pre>
lookupResponseHeader :: forall (h :: Symbol) a (headers :: [Type]) r. HasResponseHeader h a headers => Headers headers r -> ResponseHeader h a

-- | Deliberately do not add a header to a value.
--   
--   <pre>
--   &gt;&gt;&gt; let example1 = noHeader "hi" :: Headers '[Header "someheader" Int] String
--   
--   &gt;&gt;&gt; getHeaders example1
--   []
--   </pre>
noHeader :: forall (h :: Symbol) v orig new. AddHeader '[Optional, Strict] h v orig new => orig -> new

-- | Same as <a>noHeader</a> but works with <a>Header'</a>, so it's
--   possible to use any <tt>mods</tt>.
noHeader' :: forall (mods :: [Type]) (h :: Symbol) v orig new. AddHeader mods h v orig new => orig -> new
class AddHeader (mods :: [Type]) (h :: Symbol) v orig new | mods h v orig -> new, new -> mods, new -> h, new -> v, new -> orig
class BuildHeadersTo (hs :: [Type])
buildHeadersTo :: BuildHeadersTo hs => [Header] -> HList hs
class GetHeaders ls
getHeaders :: GetHeaders ls => ls -> [Header]
data HList (a :: [Type])
[HNil] :: HList ('[] :: [Type])
[HCons] :: forall (h :: Symbol) x (xs :: [Type]) (mods :: [Type]). ResponseHeader h x -> HList xs -> HList (Header' mods h x ': xs)
class HasResponseHeader (h :: Symbol) a (headers :: [Type])

-- | Response Header objects. You should never need to construct one
--   directly. Instead, use <a>addOptionalHeader</a>.
data Headers (ls :: [Type]) a
Headers :: a -> HList ls -> Headers (ls :: [Type]) a

-- | The underlying value of a <a>Headers</a>
[getResponse] :: Headers (ls :: [Type]) a -> a

-- | HList of headers.
[getHeadersHList] :: Headers (ls :: [Type]) a -> HList ls
data ResponseHeader (sym :: Symbol) a
Header :: a -> ResponseHeader (sym :: Symbol) a
MissingHeader :: ResponseHeader (sym :: Symbol) a
UndecodableHeader :: ByteString -> ResponseHeader (sym :: Symbol) a
class FromHttpApiData a
parseUrlPiece :: FromHttpApiData a => Text -> Either Text a
parseHeader :: FromHttpApiData a => ByteString -> Either Text a
parseQueryParam :: FromHttpApiData a => Text -> Either Text a
class ToHttpApiData a
toUrlPiece :: ToHttpApiData a => a -> Text
toEncodedUrlPiece :: ToHttpApiData a => a -> Builder
toHeader :: ToHttpApiData a => a -> ByteString
toQueryParam :: ToHttpApiData a => a -> Text
toEncodedQueryParam :: ToHttpApiData a => a -> Builder

-- | Create a valid (by construction) relative URI with query params.
--   
--   This function will only typecheck if <tt>endpoint</tt> is part of the
--   API <tt>api</tt>
safeLink :: (IsElem endpoint api, HasLink endpoint) => Proxy api -> Proxy endpoint -> MkLink endpoint Link
data URI
URI :: String -> Maybe URIAuth -> String -> String -> String -> URI
[uriScheme] :: URI -> String
[uriAuthority] :: URI -> Maybe URIAuth
[uriPath] :: URI -> String
[uriQuery] :: URI -> String
[uriFragment] :: URI -> String

-- | Closed type family, check if <tt>endpoint</tt> is within <tt>api</tt>.
--   Uses <tt><a>IsElem'</a></tt> if it exhausts all other options.
--   
--   <pre>
--   &gt;&gt;&gt; ok (Proxy :: Proxy (IsElem ("hello" :&gt; Get '[JSON] Int) SampleAPI))
--   OK
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; ok (Proxy :: Proxy (IsElem ("bye" :&gt; Get '[JSON] Int) SampleAPI))
--   ...
--   ... Could not ...
--   ...
--   </pre>
--   
--   An endpoint is considered within an api even if it is missing
--   combinators that don't affect the URL:
--   
--   <pre>
--   &gt;&gt;&gt; ok (Proxy :: Proxy (IsElem (Get '[JSON] Int) (Header "h" Bool :&gt; Get '[JSON] Int)))
--   OK
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; ok (Proxy :: Proxy (IsElem (Get '[JSON] Int) (ReqBody '[JSON] Bool :&gt; Get '[JSON] Int)))
--   OK
--   </pre>
--   
--   <ul>
--   <li>N.B.:* <tt>IsElem a b</tt> can be seen as capturing the notion of
--   whether the URL represented by <tt>a</tt> would match the URL
--   represented by <tt>b</tt>, *not* whether a request represented by
--   <tt>a</tt> matches the endpoints serving <tt>b</tt> (for the latter,
--   use <a>IsIn</a>).</li>
--   </ul>
type family IsElem endpoint api

-- | You may use this type family to tell the type checker that your custom
--   type may be skipped as part of a link. This is useful for things like
--   <tt><a>QueryParam</a></tt> that are optional in a URI and do not
--   affect them if they are omitted.
--   
--   <pre>
--   &gt;&gt;&gt; data CustomThing
--   
--   &gt;&gt;&gt; type instance IsElem' e (CustomThing :&gt; s) = IsElem e s
--   </pre>
--   
--   Note that <tt><a>IsElem</a></tt> is called, which will mutually
--   recurse back to <tt><a>IsElem'</a></tt> if it exhausts all other
--   options again.
--   
--   Once you have written a <tt>HasLink</tt> instance for
--   <tt>CustomThing</tt> you are ready to go.
type family IsElem' a s

-- | Construct a toLink for an endpoint.
class HasLink (endpoint :: k) where {
    type MkLink (endpoint :: k) a;
}
toLink :: HasLink endpoint => (Link -> a) -> Proxy endpoint -> Link -> MkLink endpoint a

-- | A safe link datatype. The only way of constructing a <a>Link</a> is
--   using <a>safeLink</a>, which means any <a>Link</a> is guaranteed to be
--   part of the mentioned API.
--   
--   NOTE: If you are writing a custom <a>HasLink</a> instance, and need to
--   manipulate the <a>Link</a> (adding query params or fragments,
--   perhaps), please use the the <a>addQueryParam</a> and
--   <a>addSegment</a> functions.
data Link
type family MkLink (endpoint :: k) a
type family If (cond :: Bool) (tru :: k) (fls :: k) :: k
data SBool (b :: Bool)
[STrue] :: SBool 'True
[SFalse] :: SBool 'False
class SBoolI (b :: Bool)
sbool :: SBoolI b => SBool b


-- | This is a module containing an API with all <a>API</a> combinators. It
--   is used for testing only (in particular, checking that instances exist
--   for the core servant classes for each combinator).
module Servant.Test.ComprehensiveAPI
type GET = Get '[JSON] NoContent
type ComprehensiveAPI = ComprehensiveAPIWithoutStreamingOrRaw' EmptyEndpoint :<|> StreamingEndpoint :<|> RawEndpoint
type RawEndpoint = "raw" :> Raw
type StreamingEndpoint = "streaming" :> StreamBody' '[Description "netstring"] NetstringFraming JSON SourceT IO Int :> Stream 'GET 200 NetstringFraming JSON SourceT IO Int
type EmptyEndpoint = "empty-api" :> EmptyAPI
comprehensiveAPI :: Proxy ComprehensiveAPI
type ComprehensiveAPIWithoutRaw = ComprehensiveAPIWithoutStreamingOrRaw' EmptyEndpoint :<|> StreamingEndpoint
comprehensiveAPIWithoutRaw :: Proxy ComprehensiveAPIWithoutRaw
type ComprehensiveAPIWithoutStreaming = ComprehensiveAPIWithoutStreamingOrRaw' EmptyEndpoint :<|> RawEndpoint
comprehensiveAPIWithoutStreaming :: Proxy ComprehensiveAPIWithoutStreaming

-- | <tt>:: API -&gt; API</tt>, so we have linear structure of the API.
type ComprehensiveAPIWithoutStreamingOrRaw' endpoint = GET :<|> "get-int" :> Get '[JSON] Int :<|> "capture" :> Capture' '[Description "example description"] "bar" Int :> GET :<|> "capture-lenient" :> Capture' '[Lenient] "foo" Int :> GET :<|> "header" :> Header "foo" Int :> GET :<|> "header-lenient" :> Header' '[Required, Lenient] "bar" Int :> GET :<|> "http-version" :> HttpVersion :> GET :<|> "is-secure" :> IsSecure :> GET :<|> "param" :> QueryParam "foo" Int :> GET :<|> "param-lenient" :> QueryParam' '[Required, Lenient] "bar" Int :> GET :<|> "params" :> QueryParams "foo" Int :> GET :<|> "flag" :> QueryFlag "foo" :> GET :<|> "remote-host" :> RemoteHost :> GET :<|> "req-body" :> ReqBody '[JSON] Int :> GET :<|> "req-body-lenient" :> ReqBody' '[Lenient] '[JSON] Int :> GET :<|> "res-headers" :> Get '[JSON] Headers '[Header "foo" Int] NoContent :<|> "foo" :> GET :<|> "vault" :> Vault :> GET :<|> "post-no-content" :> PostNoContent :<|> "post-int" :> Verb 'POST 204 '[JSON] Int :<|> "named-context" :> WithNamedContext "foo" '[] :: [Type] GET :<|> "capture-all" :> CaptureAll "foo" Int :> GET :<|> "summary" :> Summary "foo" :> GET :<|> "description" :> Description "foo" :> GET :<|> "alternative" :> "left" :> GET :<|> "right" :> GET :<|> "fragment" :> Fragment Int :> GET :<|> "resource" :> WithResource Int :> GET :<|> endpoint
type ComprehensiveAPIWithoutStreamingOrRaw = ComprehensiveAPIWithoutStreamingOrRaw' EmptyEndpoint
comprehensiveAPIWithoutStreamingOrRaw :: Proxy ComprehensiveAPIWithoutStreamingOrRaw

module Servant.API.Range

-- | A newtype wrapper around <a>Natural</a> that ensures the value is
--   within a given range.
--   
--   Example:
--   
--   <pre>
--   &gt;&gt;&gt; :{
--     let validRange = mkRange 5 :: Maybe (Range 1 10)
--     in case validRange of
--          Just r  -&gt; "Valid range: " ++ show (unRange r)
--          Nothing -&gt; "Invalid range"
--   :}
--   "Valid range: 5"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; :{
--     let invalidRange = mkRange 15 :: Maybe (Range 1 10)
--     in case invalidRange of
--          Just r  -&gt; "Valid range: " ++ show (unRange r)
--          Nothing -&gt; "Invalid range"
--   :}
--   "Invalid range"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decode "5" :: Maybe (Range 1 10)
--   Just (MkRange {unRange = 5})
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; decode "15" :: Maybe (Range 1 10)
--   Nothing
--   </pre>
data Range (min :: Nat) (max :: Nat)
unsafeRange :: forall (min :: Nat) (max :: Nat). Natural -> Range min max
mkRange :: forall (min :: Nat) (max :: Nat). (KnownNat min, KnownNat max) => Natural -> Maybe (Range min max)
instance (GHC.Internal.TypeNats.KnownNat min, GHC.Internal.TypeNats.KnownNat max) => GHC.Internal.Enum.Bounded (Servant.API.Range.Range min max)
instance GHC.Classes.Eq (Servant.API.Range.Range min max)
instance (GHC.Internal.TypeNats.KnownNat min, GHC.Internal.TypeNats.KnownNat max) => Web.Internal.HttpApiData.FromHttpApiData (Servant.API.Range.Range min max)
instance (GHC.Internal.TypeNats.KnownNat min, GHC.Internal.TypeNats.KnownNat max) => Data.Aeson.Types.FromJSON.FromJSON (Servant.API.Range.Range min max)
instance GHC.Internal.Generics.Generic (Servant.API.Range.Range min max)
instance GHC.Internal.Ix.Ix (Servant.API.Range.Range min max)
instance GHC.Classes.Ord (Servant.API.Range.Range min max)
instance GHC.Internal.Show.Show (Servant.API.Range.Range min max)
instance Web.Internal.HttpApiData.ToHttpApiData (Servant.API.Range.Range min max)
instance Data.Aeson.Types.ToJSON.ToJSON (Servant.API.Range.Range min max)
