webgear-server-0.1.0: Composable, type-safe library to build HTTP API servers
Copyright(c) Raghu Kaippully 2020
LicenseMPL-2.0
Maintainerrkaippully@gmail.com
Safe HaskellNone
LanguageHaskell2010

WebGear.Trait.Path

Description

Traits related to the route path of a request.

Synopsis

Documentation

data Path (s :: Symbol) Source #

A path component which is literally matched against the request but discarded after that.

Instances

Instances details
(KnownSymbol s, Monad m) => Trait (Path s :: Type) Request m Source # 
Instance details

Defined in WebGear.Trait.Path

Associated Types

type Val (Path s) Request Source #

type Fail (Path s) Request Source #

type Val (Path s :: Type) Request Source # 
Instance details

Defined in WebGear.Trait.Path

type Val (Path s :: Type) Request = ()
type Fail (Path s :: Type) Request Source # 
Instance details

Defined in WebGear.Trait.Path

type Fail (Path s :: Type) Request = ()

data PathVar tag (val :: Type) Source #

A path variable that is extracted and converted to a value of type val. The tag is usually a type-level symbol (string) to uniquely identify this variable.

Instances

Instances details
(FromHttpApiData val, Monad m) => Trait (PathVar tag val :: Type) Request m Source # 
Instance details

Defined in WebGear.Trait.Path

Associated Types

type Val (PathVar tag val) Request Source #

type Fail (PathVar tag val) Request Source #

Methods

check :: Request -> m (CheckResult (PathVar tag val) Request) Source #

type Val (PathVar tag val :: Type) Request Source # 
Instance details

Defined in WebGear.Trait.Path

type Val (PathVar tag val :: Type) Request = val
type Fail (PathVar tag val :: Type) Request Source # 
Instance details

Defined in WebGear.Trait.Path

type Fail (PathVar tag val :: Type) Request = PathVarFail