prolude-0.0.0.30: ACI Learning's custom prelude
Safe HaskellSafe-Inferred
LanguageHaskell2010

Prolude.Servant

Synopsis

Servant re-exports

class ToHttpApiData a #

Convert value to HTTP API data.

WARNING: Do not derive this using DeriveAnyClass as the generated instance will loop indefinitely.

Minimal complete definition

toUrlPiece | toQueryParam

Instances

Instances details
ToHttpApiData All 
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData Any 
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData Version
>>> toUrlPiece (Version [1, 2, 3] [])
"1.2.3"
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData Void 
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData Int16 
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData Int32 
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData Int64 
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData Int8 
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData Word16 
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData Word32 
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData Word64 
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData Word8 
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData SetCookie

Note: this instance works correctly for alphanumeric name and value

>>> let Right c = parseUrlPiece "SESSID=r2t5uvjq435r4q7ib3vtdjq120" :: Either Text SetCookie
>>> toUrlPiece c
"SESSID=r2t5uvjq435r4q7ib3vtdjq120"
>>> toHeader c
"SESSID=r2t5uvjq435r4q7ib3vtdjq120"
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData Ordering 
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData Checkmark 
Instance details

Defined in Database.Persist.Types.Base

ToHttpApiData Link 
Instance details

Defined in Servant.Links

ToHttpApiData Text 
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData Text 
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData Day
>>> toUrlPiece (fromGregorian 2015 10 03)
"2015-10-03"
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData Month
>>> import Data.Time.Calendar.Month.Compat (Month (..))
>>> MkMonth 24482
2040-03
>>> toUrlPiece $ MkMonth 24482
"2040-03"
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData Quarter
>>> import Data.Time.Calendar.Quarter.Compat (Quarter (..))
>>> MkQuarter 8040
2010-Q1
>>> toUrlPiece $ MkQuarter 8040
"2010-q1"
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData QuarterOfYear
>>> toUrlPiece Q4
"q4"
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData DayOfWeek
>>> toUrlPiece Monday
"monday"
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData NominalDiffTime 
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData UTCTime
>>> toUrlPiece $ UTCTime (fromGregorian 2015 10 03) 864.5
"2015-10-03T00:14:24.5Z"
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData LocalTime
>>> toUrlPiece $ LocalTime (fromGregorian 2015 10 03) (TimeOfDay 14 55 21.687)
"2015-10-03T14:55:21.687"
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData TimeOfDay
>>> toUrlPiece $ TimeOfDay 14 55 23.1
"14:55:23.1"
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData ZonedTime
>>> toUrlPiece $ ZonedTime (LocalTime (fromGregorian 2015 10 03) (TimeOfDay 14 55 51.001)) utc
"2015-10-03T14:55:51.001+0000"
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData UUID 
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData String 
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData Integer 
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData Natural 
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData ()
>>> toUrlPiece ()
"_"
Instance details

Defined in Web.Internal.HttpApiData

Methods

toUrlPiece :: () -> Text #

toEncodedUrlPiece :: () -> Builder #

toHeader :: () -> ByteString #

toQueryParam :: () -> Text #

ToHttpApiData Bool 
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData Char 
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData Double 
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData Float 
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData Int 
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData Word 
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData a => ToHttpApiData (Identity a)

Since: http-api-data-0.4.2

Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData a => ToHttpApiData (First a) 
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData a => ToHttpApiData (Last a) 
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData a => ToHttpApiData (First a) 
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData a => ToHttpApiData (Last a) 
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData a => ToHttpApiData (Max a) 
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData a => ToHttpApiData (Min a) 
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData a => ToHttpApiData (Dual a) 
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData a => ToHttpApiData (Product a) 
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData a => ToHttpApiData (Sum a) 
Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData a => ToHttpApiData (Maybe a)
>>> toUrlPiece (Just "Hello")
"just Hello"
Instance details

Defined in Web.Internal.HttpApiData

(ToHttpApiData a, ToHttpApiData b) => ToHttpApiData (Either a b)
>>> toUrlPiece (Left "err" :: Either String Int)
"left err"
>>> toUrlPiece (Right 3 :: Either String Int)
"right 3"
Instance details

Defined in Web.Internal.HttpApiData

HasResolution a => ToHttpApiData (Fixed a)

Note: this instance is not polykinded

Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData a => ToHttpApiData (Const a b)

Since: http-api-data-0.4.2

Instance details

Defined in Web.Internal.HttpApiData

ToHttpApiData a => ToHttpApiData (Tagged b a)

Note: this instance is not polykinded

Instance details

Defined in Web.Internal.HttpApiData

class FromHttpApiData a where #

Parse value from HTTP API data.

WARNING: Do not derive this using DeriveAnyClass as the generated instance will loop indefinitely.

Minimal complete definition

parseUrlPiece | parseQueryParam

Methods

parseUrlPiece :: Text -> Either Text a #

Parse URL path piece.

parseHeader :: ByteString -> Either Text a #

Parse HTTP header value.

parseQueryParam :: Text -> Either Text a #

Parse query param value.

Instances

Instances details
FromHttpApiData All 
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData Any 
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData Version
>>> showVersion <$> parseUrlPiece "1.2.3"
Right "1.2.3"
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData Void

Parsing a Void value is always an error, considering Void as a data type with no constructors.

Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData Int16 
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData Int32 
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData Int64 
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData Int8 
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData Word16 
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData Word32 
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData Word64 
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData Word8 
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData SetCookie

Note: this instance works correctly for alphanumeric name and value

>>> parseUrlPiece "SESSID=r2t5uvjq435r4q7ib3vtdjq120" :: Either Text SetCookie
Right (SetCookie {setCookieName = "SESSID", setCookieValue = "r2t5uvjq435r4q7ib3vtdjq120", setCookiePath = Nothing, setCookieExpires = Nothing, setCookieMaxAge = Nothing, setCookieDomain = Nothing, setCookieHttpOnly = False, setCookieSecure = False, setCookieSameSite = Nothing})
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData Ordering 
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData Checkmark 
Instance details

Defined in Database.Persist.Types.Base

FromHttpApiData Text 
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData Text 
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData Day
>>> toGregorian <$> parseUrlPiece "2016-12-01"
Right (2016,12,1)
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData Month
>>> parseUrlPiece "2021-01" :: Either Text Month
Right 2021-01
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData Quarter
>>> parseUrlPiece "2021-q1" :: Either Text Quarter
Right 2021-Q1
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData QuarterOfYear
>>> parseUrlPiece "q2" :: Either Text QuarterOfYear
Right Q2
>>> parseUrlPiece "Q3" :: Either Text QuarterOfYear
Right Q3
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData DayOfWeek
>>> parseUrlPiece "Monday" :: Either Text DayOfWeek
Right Monday
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData NominalDiffTime 
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData UTCTime
>>> parseUrlPiece "2015-10-03T00:14:24Z" :: Either Text UTCTime
Right 2015-10-03 00:14:24 UTC
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData LocalTime
>>> parseUrlPiece "2015-10-03T14:55:01" :: Either Text LocalTime
Right 2015-10-03 14:55:01
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData TimeOfDay
>>> parseUrlPiece "14:55:01.333" :: Either Text TimeOfDay
Right 14:55:01.333
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData ZonedTime
>>> parseUrlPiece "2015-10-03T14:55:01+0000" :: Either Text ZonedTime
Right 2015-10-03 14:55:01 +0000
>>> parseQueryParam "2016-12-31T01:00:00Z" :: Either Text ZonedTime
Right 2016-12-31 01:00:00 +0000
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData UUID 
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData String 
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData Integer 
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData Natural 
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData ()
>>> parseUrlPiece "_" :: Either Text ()
Right ()
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData Bool 
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData Char 
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData Double 
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData Float 
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData Int 
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData Word 
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData a => FromHttpApiData (Identity a)

Since: http-api-data-0.4.2

Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData a => FromHttpApiData (First a) 
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData a => FromHttpApiData (Last a) 
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData a => FromHttpApiData (First a) 
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData a => FromHttpApiData (Last a) 
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData a => FromHttpApiData (Max a) 
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData a => FromHttpApiData (Min a) 
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData a => FromHttpApiData (Dual a) 
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData a => FromHttpApiData (Product a) 
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData a => FromHttpApiData (Sum a) 
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData a => FromHttpApiData (LenientData a) 
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData a => FromHttpApiData (Maybe a)
>>> parseUrlPiece "Just 123" :: Either Text (Maybe Int)
Right (Just 123)
Instance details

Defined in Web.Internal.HttpApiData

(FromHttpApiData a, FromHttpApiData b) => FromHttpApiData (Either a b)
>>> parseUrlPiece "Right 123" :: Either Text (Either String Int)
Right (Right 123)
Instance details

Defined in Web.Internal.HttpApiData

HasResolution a => FromHttpApiData (Fixed a)

Note: this instance is not polykinded

Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData a => FromHttpApiData (Const a b)

Since: http-api-data-0.4.2

Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData a => FromHttpApiData (Tagged b a)

Note: this instance is not polykinded

Instance details

Defined in Web.Internal.HttpApiData

type Get = Verb 'GET 200 #

GET with 200 status code.

type Post = Verb 'POST 200 #

POST with 200 status code.

type Put = Verb 'PUT 200 #

PUT with 200 status code.

type Delete = Verb 'DELETE 200 #

DELETE with 200 status code.

type GetNoContent = NoContentVerb 'GET #

GET with 204 status code.

type PostNoContent = NoContentVerb 'POST #

POST with 204 status code.

type DeleteNoContent = NoContentVerb 'DELETE #

DELETE with 204 status code.

type PutNoContent = NoContentVerb 'PUT #

PUT with 204 status code.

data (path :: k) :> a infixr 4 #

The contained API (second argument) can be found under ("/" ++ path) (path being the first argument).

Example:

>>> -- GET /hello/world
>>> -- returning a JSON encoded World value
>>> type MyApi = "hello" :> "world" :> Get '[JSON] World

Instances

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

Defined in Servant.Links

Associated Types

type MkLink (arr :> sub) a #

Methods

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

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

Defined in Servant.Links

Associated Types

type MkLink (Vault :> sub) a #

Methods

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

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

Defined in Servant.Links

Associated Types

type MkLink (sym :> sub) a #

Methods

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

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

Defined in Servant.Links

Associated Types

type MkLink (HttpVersion :> sub) a #

Methods

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

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

Defined in Servant.Links

Associated Types

type MkLink (BasicAuth realm a :> sub) a #

Methods

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

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

Defined in Servant.Links

Associated Types

type MkLink (Capture' mods sym v :> sub) a #

Methods

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

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

Defined in Servant.Links

Associated Types

type MkLink (CaptureAll sym v :> sub) a #

Methods

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

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

Defined in Servant.Links

Associated Types

type MkLink (Description s :> sub) a #

Methods

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

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

Defined in Servant.Links

Associated Types

type MkLink (Summary s :> sub) a #

Methods

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

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

Defined in Servant.Links

Associated Types

type MkLink (AuthProtect tag :> sub) a #

Methods

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

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

Defined in Servant.Links

Associated Types

type MkLink (Fragment v :> sub) a #

Methods

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

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

Defined in Servant.Links

Associated Types

type MkLink (Header' mods sym a :> sub) a #

Methods

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

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

Defined in Servant.Links

Associated Types

type MkLink (IsSecure :> sub) a #

Methods

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

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

Defined in Servant.Links

Associated Types

type MkLink (QueryFlag sym :> sub) a #

Methods

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

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

Defined in Servant.Links

Associated Types

type MkLink (QueryParam' mods sym v :> sub) a #

Methods

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

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

Defined in Servant.Links

Associated Types

type MkLink (QueryParams sym v :> sub) a #

Methods

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

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

Defined in Servant.Links

Associated Types

type MkLink (RemoteHost :> sub) a #

Methods

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

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

Defined in Servant.Links

Associated Types

type MkLink (ReqBody' mods ct a :> sub) a #

Methods

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

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

Defined in Servant.Links

Associated Types

type MkLink (StreamBody' mods framing ct a :> sub) a #

Methods

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

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

Defined in Servant.Links

Associated Types

type MkLink (ty :> sub) a #

Methods

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

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

Defined in Servant.Links

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

Defined in Servant.Links

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

Defined in Servant.Links

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

Defined in Servant.Links

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

Defined in Servant.Links

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

Defined in Servant.Links

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

Defined in Servant.Links

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

Defined in Servant.Links

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

Defined in Servant.Links

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

Defined in Servant.Links

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

Defined in Servant.Links

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

Defined in Servant.Links

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

Defined in Servant.Links

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

Defined in Servant.Links

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

Defined in Servant.Links

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

Defined in Servant.Links

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

Defined in Servant.Links

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

Defined in Servant.Links

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

Defined in Servant.Links

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

type ReqBody = ReqBody' '[Required, Strict] #

Extract the request body as a value of type a.

Example:

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

data NoContent #

A type for responses without content-body.

Constructors

NoContent 

Instances

Instances details
Generic NoContent 
Instance details

Defined in Servant.API.ContentTypes

Associated Types

type Rep NoContent :: Type -> Type #

Read NoContent 
Instance details

Defined in Servant.API.ContentTypes

Show NoContent 
Instance details

Defined in Servant.API.ContentTypes

NFData NoContent 
Instance details

Defined in Servant.API.ContentTypes

Methods

rnf :: NoContent -> () #

Eq NoContent 
Instance details

Defined in Servant.API.ContentTypes

HasStatus NoContent

If an API can respond with NoContent we assume that this will happen with the status code 204 No Content. If this needs to be overridden, WithStatus can be used.

Instance details

Defined in Servant.API.UVerb

Associated Types

type StatusOf NoContent :: Nat #

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

Defined in Servant.API.ContentTypes

Methods

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

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

Defined in Servant.API.ContentTypes

Methods

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

type Rep NoContent 
Instance details

Defined in Servant.API.ContentTypes

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

Defined in Servant.API.UVerb

type StatusOf NoContent = 204

data a :<|> b infixr 3 #

Union of two APIs, first takes precedence in case of overlap.

Example:

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

Constructors

a :<|> b infixr 3 

Instances

Instances details
Bifoldable (:<|>) 
Instance details

Defined in Servant.API.Alternative

Methods

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

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

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

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

Bifunctor (:<|>) 
Instance details

Defined in Servant.API.Alternative

Methods

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

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

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

Bitraversable (:<|>) 
Instance details

Defined in Servant.API.Alternative

Methods

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

Biapplicative (:<|>) 
Instance details

Defined in Servant.API.Alternative

Methods

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

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

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

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

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

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

Defined in Servant.Links

Associated Types

type MkLink (a :<|> b) a #

Methods

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

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

Defined in Servant.API.Alternative

Methods

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Defined in Servant.API.Alternative

Methods

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

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

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

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

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

Defined in Servant.API.Alternative

Methods

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

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

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

Defined in Servant.API.Alternative

Methods

mempty :: a :<|> b #

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

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

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

Defined in Servant.API.Alternative

Methods

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

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

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

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

Defined in Servant.API.Alternative

Methods

minBound :: a :<|> b #

maxBound :: a :<|> b #

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

Defined in Servant.API.Alternative

Methods

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

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

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

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

Defined in Servant.API.Alternative

Methods

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

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

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

Defined in Servant.Links

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

Alias types