snap-app-0.6.0: Simple modules for writing apps with Snap, abstracted from hpaste.

Safe HaskellNone

Snap.App.Types

Description

Model-view-controller app types.

Synopsis

Documentation

newtype Controller config state a Source

The controller monad.

Constructors

Controller 

Fields

runController :: ReaderT (ControllerState config state) Snap a
 

Instances

Monad (Controller config state) 
Functor (Controller config state) 
MonadPlus (Controller config state) 
Applicative (Controller config state) 
MonadCatchIO (Controller config state) 
Alternative (Controller config state) 
MonadIO (Controller config state) 
MonadSnap (Controller config state) 
MonadReader (ControllerState config state) (Controller config state) 

newtype Model config state a Source

The model monad (limited access to IO, only DB access).

Constructors

Model 

Fields

runModel :: ReaderT (ModelState config state) IO a
 

Instances

Monad (Model config state) 
Functor (Model config state) 
Applicative (Model config state) 
MonadIO (Model config state) 
MonadReader (ModelState config state) (Model config state) 

data ControllerState config state Source

The state accessible to the controller (DB/session stuff).

Instances

MonadReader (ControllerState config state) (Controller config state) 

data ModelState config state Source

The state accessible to the model (just DB connection).

Constructors

ModelState 

Instances

MonadReader (ModelState config state) (Model config state) 

class AppConfig config whereSource

Methods

getConfigDomain :: config -> StringSource

class AppLiftModel c s whereSource

Methods

liftModel :: Model c s a -> Controller c s aSource