servant-hateoas-0.3.4: HATEOAS extension for servant
Safe HaskellSafe-Inferred
LanguageGHC2021

Servant.Hateoas.Internal.Sym

Synopsis

Type

data Sym (sym :: Symbol) Source #

A wrapper for path segments of kind Symbol.

Instances

Instances details
(HasLink api, KnownSymbol sym) => HasLink (Sym sym :> api :: Type) Source # 
Instance details

Defined in Servant.Hateoas.Internal.Sym

Associated Types

type MkLink (Sym sym :> api) a #

Methods

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

(HasHandler api, KnownSymbol sym) => HasHandler (Sym sym :> api :: Type) Source # 
Instance details

Defined in Servant.Hateoas.Internal.Sym

Methods

getHandler :: forall (m :: Type -> Type). MonadIO m => Proxy m -> Proxy (Sym sym :> api) -> ServerT (Sym sym :> api) m Source #

(KnownSymbol sym, HasRelationLink (sym :> api), HasLink api) => HasRelationLink (Sym sym :> api :: Type) Source # 
Instance details

Defined in Servant.Hateoas.Internal.Sym

Methods

toRelationLink :: Proxy (Sym sym :> api) -> MkLink (Sym sym :> api) RelationLink Source #

(HasTemplatedLink api, KnownSymbol sym) => HasTemplatedLink (Sym sym :> api :: Type) Source # 
Instance details

Defined in Servant.Hateoas.Internal.Sym

(HasServer api context, KnownSymbol sym) => HasServer (Sym sym :> api :: Type) context Source # 
Instance details

Defined in Servant.Hateoas.Internal.Sym

Associated Types

type ServerT (Sym sym :> api) m #

Methods

route :: Proxy (Sym sym :> api) -> Context context -> Delayed env (Server (Sym sym :> api)) -> Router env #

hoistServerWithContext :: Proxy (Sym sym :> api) -> Proxy context -> (forall x. m x -> n x) -> ServerT (Sym sym :> api) m -> ServerT (Sym sym :> api) n #

(c ~ MkPrefix (apiCs ++ '[Sym sym]) verb, HasRelationLink c, mkLink ~ MkLink c RelationLink, KnownSymbol sym, BuildLayerLinks ('Layer apiCs cs verb) m, buildLinksFun ~ ReplaceHandler (ServerT (MkPrefix apiCs verb) m) [(String, RelationLink)], PolyvariadicComp2 mkLink buildLinksFun (IsFun mkLink), Return2 mkLink buildLinksFun (IsFun mkLink) ~ (RelationLink, [(String, RelationLink)]), Replace2 mkLink buildLinksFun [(String, RelationLink)] (IsFun mkLink) ~ buildLinksFun) => BuildLayerLinks ('Layer apiCs (Sym sym ': cs) verb) m Source # 
Instance details

Defined in Servant.Hateoas.Layer.Build

Methods

buildLayerLinks :: Proxy ('Layer apiCs (Sym sym ': cs) verb) -> Proxy m -> ReplaceHandler (ServerT ('Layer apiCs (Sym sym ': cs) verb) m) [(String, RelationLink)] Source #

type MkLink (Sym sym :> api :: Type) link Source # 
Instance details

Defined in Servant.Hateoas.Internal.Sym

type MkLink (Sym sym :> api :: Type) link = MkLink (sym :> api) link
type ServerT (Sym sym :> api :: Type) m Source # 
Instance details

Defined in Servant.Hateoas.Internal.Sym

type ServerT (Sym sym :> api :: Type) m = ServerT (sym :> api) m

Type family

type family Symify api where ... Source #

A type family that wraps all path segments of kind Symbol in an API with Sym.

Equations

Symify (a :<|> b) = Symify a :<|> Symify b 
Symify ((sym :: Symbol) :> b) = Sym sym :> Symify b 
Symify (a :> b) = a :> Symify b 
Symify a = a