simple-0.11.2: A minimalist web framework for the WAI server interface

Safe Haskell | Trustworthy
Language | Haskell2010

Web.REST

Description

REST is a DSL for creating routes using RESTful HTTP verbs. See http://en.wikipedia.org/wiki/Representational_state_transfer

Synopsis

- data REST m s = REST {
  - restIndex :: ControllerT s m ()
  - restShow :: ControllerT s m ()
  - restCreate :: ControllerT s m ()
  - restUpdate :: ControllerT s m ()
  - restDelete :: ControllerT s m ()
  - restEdit :: ControllerT s m ()
  - restNew :: ControllerT s m ()
  }
- type RESTController m r = RESTControllerM m r ()
- rest :: Monad m => RESTControllerM m r a -> REST m r
- routeREST :: Monad m => REST m s -> ControllerT s m ()
- index :: ControllerT s m () -> RESTController m s
- show :: ControllerT s m () -> RESTController m s
- create :: ControllerT s m () -> RESTController m s
- update :: ControllerT s m () -> RESTController m s
- delete :: ControllerT s m () -> RESTController m s
- edit :: ControllerT s m () -> RESTController m s
- new :: ControllerT s m () -> RESTController m s

# Documentation

data REST m s Source #

Type used to encode a REST controller.

Constructors

REST |

Fields

- restIndex :: ControllerT s m ()
- restShow :: ControllerT s m ()
- restCreate :: ControllerT s m ()
- restUpdate :: ControllerT s m ()
- restDelete :: ControllerT s m ()
- restEdit :: ControllerT s m ()
- restNew :: ControllerT s m ()

type RESTController m r = RESTControllerM m r () Source #

rest :: Monad m => RESTControllerM m r a -> REST m r Source #

routeREST :: Monad m => REST m s -> ControllerT s m () Source #

index :: ControllerT s m () -> RESTController m s Source #

GET /

show :: ControllerT s m () -> RESTController m s Source #

GET /:id

create :: ControllerT s m () -> RESTController m s Source #

POST /

update :: ControllerT s m () -> RESTController m s Source #

PUT /:id

delete :: ControllerT s m () -> RESTController m s Source #

DELETE /:id

edit :: ControllerT s m () -> RESTController m s Source #

GET /:id/edit

new :: ControllerT s m () -> RESTController m s Source #

GET /new