Type.Trout
- Package
- purescript-trout
- Repository
- owickstrom/purescript-trout
#CaptureAll Source
data CaptureAll (v :: Symbol) tCaptures all remaining segments of a path, all as type t. The v
is a Symbol that describes
#Resource Source
data Resource ms ctsA type-level description of the HTTP resource r, terminating a chain of
path literals, captures, and other endpoint type constructs. The ms are
the methods handled by this resource. cts are the content types that
this resource supports.
#Sub Source
data Sub e tThe 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 bAltE 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