Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Routes
data Get (content :: Type) Source #
An endpoint serving content of type content :: *
.
Content types are ignored here.
data Capture (component :: Type) Source #
A route component that is captured.
data (a :: Type) :<|> (b :: Type) infixr 8 Source #
Choice between two routes.
a :<|> b infixr 8 |
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
(KnownSymbol s, HasServer r) => HasServer (s :/ r :: Type) Source # | An endpoint nested under a static path may be served. |
(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. |
type Server (s :/ r :: Type) Source # | |
type Server (Capture a :/ r :: Type) Source # | |
Servers
class HasServer (layout :: k) where Source #
Types which have servers!
route :: Proxy layout -> Server layout -> [String] -> Maybe (Orc String) Source #
Request router for a particular layout
.
Instances
Show content => HasServer (Get content :: Type) Source # | Endpoints may be served. |
(HasServer a, HasServer b) => HasServer (a :<|> b :: Type) Source # | Given the choice of two routes, either may be served. |
(KnownSymbol s, HasServer r) => HasServer (s :/ r :: Type) Source # | An endpoint nested under a static path may be served. |
(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. |
serve :: HasServer layout => Proxy layout -> Server layout -> [String] -> Orc String Source #
Builds an Orc
computation to serve requests matching some URL layout.