Type.Trout
- Package
- purescript-trout
- Repository
- owickstrom/purescript-trout
#CaptureAll Source
data CaptureAll (v :: Symbol) t
Captures all remaining segments of a path, all as type t
. The v
is a Symbol
that describes the captured value.
#Resource Source
data Resource ms
A type-level description of an HTTP resource, terminating a chain of
path literals, captures, and other endpoint type constructs. The ms
are
the methods handled by this resource.
#Sub Source
data Sub e t
The Sub
is used to create the chain of Lit
, Capture
, Resource
,
and other such type constructs that build up an endpoint type. Sub
is more often used infix with the :>
operator.
#AltE Source
data AltE a b
AltE
respresents choice, i.e. that endpoint a
is tried first, and if
it fails, b
is tried next. AltE
is written infix using :<|>
and is
used to compose multiple endpoint types into a larger API or site. It is
used to build up recursive structures, so AltE a (AltE b c)
can be
written a :<|> b :<|> c
.
It it also used to extract information from a type, where the information
has the same structure as the type. For instance, when extracting links
from an AltE
type, you can pattern match the result using :<|>
to access the links of a
and b
. That also works recursively with a
pattern match like a :<|> b :<|> c :<|> d
.
Constructors
AltE a b
#QueryParam Source
data QueryParam (k :: Symbol) t
Captures the first value of the query string parameter, or Nothing
. t
is the type of the value. k
is the name of the key as a Symbol
.
#QueryParams Source
data QueryParams (k :: Symbol) t
Captures all values of the query string parameter, or []
. t
is the
type of the value. k
is the name of the key as a Symbol
.