Safe Haskell | None |
---|---|
Language | Haskell98 |
A Resource
type for representing a REST resource, as well as
smart constructors for empty resources which can then be filled in
using record updates.
- data Resource m s sid mid aid where
- Resource :: (Applicative m, Monad m, Applicative s, Monad s) => {..} -> Resource m s sid mid aid
- mkResource :: (Applicative m, Monad m, Applicative s, Monad s) => (forall b. sid -> s b -> m b) -> Resource m s sid Void Void
- mkResourceId :: (Applicative m, Monad m) => Resource m m sid Void Void
- mkResourceReader :: (Applicative m, Monad m) => Resource m (ReaderT sid m) sid Void Void
- mkResourceReaderWith :: (Applicative m, Monad m, Applicative s, Monad s) => (forall b. s b -> ReaderT sid m b) -> Resource m s sid Void Void
- module Rest.Types.Void
Documentation
data Resource m s sid mid aid where Source #
The Resource
data type represents a single resource in a REST
API. Handlers run in a monad m
, while things below this resource
run in s
. The identifiers sid
, mid
and aid
identify a
single item, a listing and an action.
Resource :: (Applicative m, Monad m, Applicative s, Monad s) => {..} -> Resource m s sid mid aid | |
|
mkResource :: (Applicative m, Monad m, Applicative s, Monad s) => (forall b. sid -> s b -> m b) -> Resource m s sid Void Void Source #
Create an empty resource given an enter
function. It has no
name, so if you wish to route to this resource, you should set one.
mkResourceId :: (Applicative m, Monad m) => Resource m m sid Void Void Source #
mkResourceReader :: (Applicative m, Monad m) => Resource m (ReaderT sid m) sid Void Void Source #
Make a resource that provides the single resource identifier to its subresources.
mkResourceReaderWith :: (Applicative m, Monad m, Applicative s, Monad s) => (forall b. s b -> ReaderT sid m b) -> Resource m s sid Void Void Source #
module Rest.Types.Void