garden
Safe HaskellNone
LanguageHaskell2010

Servant

Synopsis

Routes

data Get (content :: Type) Source #

An endpoint serving content of type content :: *. Content types are ignored here.

Instances

Instances details
Show content => HasServer (Get content :: Type) Source #

Endpoints may be served.

Instance details

Defined in Servant

Associated Types

type Server (Get content) Source #

Methods

route :: Proxy (Get content) -> Server (Get content) -> [String] -> Maybe (Orc String) Source #

type Server (Get content :: Type) Source # 
Instance details

Defined in Servant

type Server (Get content :: Type) = Orc content

data Capture (component :: Type) Source #

A route component that is captured.

Instances

Instances details
(Read a, HasServer r) => HasServer (Capture a :> r :: Type) Source #

An endpoint nested under a dynamic path may be served using the content of the path.

Instance details

Defined in Servant

Associated Types

type Server (Capture a :> r) Source #

Methods

route :: Proxy (Capture a :> r) -> Server (Capture a :> r) -> [String] -> Maybe (Orc String) Source #

type Server (Capture a :> r :: Type) Source # 
Instance details

Defined in Servant

type Server (Capture a :> r :: Type) = a -> Server r

data (a :: Type) :<|> (b :: Type) infixr 8 Source #

Choice between two routes.

Constructors

a :<|> b infixr 8 

Instances

Instances details
(HasServer a, HasServer b) => HasServer (a :<|> b :: Type) Source #

Given the choice of two routes, either may be served.

Instance details

Defined in Servant

Associated Types

type Server (a :<|> b) Source #

Methods

route :: Proxy (a :<|> b) -> Server (a :<|> b) -> [String] -> Maybe (Orc String) Source #

type Server (a :<|> b :: Type) Source # 
Instance details

Defined in Servant

type Server (a :<|> b :: Type) = Server a :<|> Server b

data (component :: k) :> (rest :: Type) infixr 9 Source #

Nested routes. component :: k is either a type-level string or a Capture. Because these two possibilities have different kinds we make component kind-polymorphic.

Instances

Instances details
(Read a, HasServer r) => HasServer (Capture a :> r :: Type) Source #

An endpoint nested under a dynamic path may be served using the content of the path.

Instance details

Defined in Servant

Associated Types

type Server (Capture a :> r) Source #

Methods

route :: Proxy (Capture a :> r) -> Server (Capture a :> r) -> [String] -> Maybe (Orc String) Source #

(KnownSymbol s, HasServer r) => HasServer (s :> r :: Type) Source #

An endpoint nested under a static path may be served.

Instance details

Defined in Servant

Associated Types

type Server (s :> r) Source #

Methods

route :: Proxy (s :> r) -> Server (s :> r) -> [String] -> Maybe (Orc String) Source #

type Server (Capture a :> r :: Type) Source # 
Instance details

Defined in Servant

type Server (Capture a :> r :: Type) = a -> Server r
type Server (s :> r :: Type) Source # 
Instance details

Defined in Servant

type Server (s :> r :: Type) = Server r

Servers

class HasServer (layout :: k) where Source #

Types which have servers!

Associated Types

type Server layout :: Type Source #

Responds to requests matching some route layout.

Methods

route :: Proxy layout -> Server layout -> [String] -> Maybe (Orc String) Source #

Implementation of a Server for a particular layout.

Instances

Instances details
Show content => HasServer (Get content :: Type) Source #

Endpoints may be served.

Instance details

Defined in Servant

Associated Types

type Server (Get content) Source #

Methods

route :: Proxy (Get content) -> Server (Get content) -> [String] -> Maybe (Orc String) Source #

(HasServer a, HasServer b) => HasServer (a :<|> b :: Type) Source #

Given the choice of two routes, either may be served.

Instance details

Defined in Servant

Associated Types

type Server (a :<|> b) Source #

Methods

route :: Proxy (a :<|> b) -> Server (a :<|> b) -> [String] -> Maybe (Orc String) Source #

(Read a, HasServer r) => HasServer (Capture a :> r :: Type) Source #

An endpoint nested under a dynamic path may be served using the content of the path.

Instance details

Defined in Servant

Associated Types

type Server (Capture a :> r) Source #

Methods

route :: Proxy (Capture a :> r) -> Server (Capture a :> r) -> [String] -> Maybe (Orc String) Source #

(KnownSymbol s, HasServer r) => HasServer (s :> r :: Type) Source #

An endpoint nested under a static path may be served.

Instance details

Defined in Servant

Associated Types

type Server (s :> r) Source #

Methods

route :: Proxy (s :> r) -> Server (s :> r) -> [String] -> Maybe (Orc String) Source #

type family Server layout :: Type Source #

Responds to requests matching some route layout.

Instances

Instances details
type Server (Get content :: Type) Source # 
Instance details

Defined in Servant

type Server (Get content :: Type) = Orc content
type Server (a :<|> b :: Type) Source # 
Instance details

Defined in Servant

type Server (a :<|> b :: Type) = Server a :<|> Server b
type Server (Capture a :> r :: Type) Source # 
Instance details

Defined in Servant

type Server (Capture a :> r :: Type) = a -> Server r
type Server (s :> r :: Type) Source # 
Instance details

Defined in Servant

type Server (s :> r :: Type) = Server r

serve :: HasServer layout => Proxy layout -> Server layout -> [String] -> Orc String Source #

Builds an Orc computation to serve requests matching some URL layout.

Utilities

data Proxy (a :: k) Source #

Constructors

Proxy