Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Servant.Hateoas.Layer.Type
Synopsis
- data Layer = Layer {}
- type family LayerApiCs (a :: Layer) where ...
- type family RelativeChildren (a :: Layer) where ...
- type family LayerVerb (a :: Layer) where ...
- type family LayerApi (a :: Layer) where ...
- type family MkPrefix prefix api where ...
- type (++) xs ys = AppendList xs ys
- newtype Intermediate = Intermediate ()
- type GetIntermediate = Get '[] Intermediate
Type
Data-kind for a layer in an API.
Example
'Layer
'[Sym
"api",Sym
"user"] '[Capture
"id"Int
,Sym
"vip"]GetIntermediate
Represents the API
"api" :> "user" :> GetIntermediate
with children
"api" :> "user" :>Capture
"id"Int
:>GetIntermediate
and
"api" :> "user" :> "vip" :> GetIntermediate
Constructors
Layer | |
Instances
Getter
type family LayerApiCs (a :: Layer) where ... Source #
Type-level getter for the API of a Layer
.
Equations
LayerApiCs ('Layer api _ _) = api |
type family RelativeChildren (a :: Layer) where ... Source #
Type-level getter for the children of a Layer
.
Equations
RelativeChildren ('Layer _ children _) = children |
API-construction
type family MkPrefix prefix api where ... Source #
Folds a list of path segments into an API by intercalating (:>)
.
Example
MkPrefix
'[Sym
"api",Sym
"user"]GetIntermediate
resolves to
Sym
"api" :>Sym
"user" :>GetIntermediate
type (++) xs ys = AppendList xs ys Source #
Convenience alias for AppendList
.
Intermediate
newtype Intermediate Source #
A response type for a Layer
that does not contain any data.
Constructors
Intermediate () |
Instances
type GetIntermediate = Get '[] Intermediate Source #