Safe Haskell | None |
---|
Model-view-controller app types.
- newtype Controller config state a = Controller {
- runController :: ReaderT (ControllerState config state) Snap a
- newtype Model config state a = Model {
- runModel :: ReaderT (ModelState config state) IO a
- data ControllerState config state = ControllerState {
- controllerStateConfig :: config
- controllerStateConn :: Connection
- controllerState :: state
- data ModelState config state = ModelState {
- modelStateConn :: Connection
- modelStateAnns :: state
- modelStateConfig :: config
- class AppConfig config where
- getConfigDomain :: config -> String
- class AppLiftModel c s where
- liftModel :: Model c s a -> Controller c s a
Documentation
newtype Controller config state a Source
The controller monad.
Controller | |
|
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).
Model | |
|
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).
ControllerState | |
|
MonadReader (ControllerState config state) (Controller config state) |
data ModelState config state Source
The state accessible to the model (just DB connection).
ModelState | |
|
MonadReader (ModelState config state) (Model config state) |
class AppConfig config whereSource
getConfigDomain :: config -> StringSource
class AppLiftModel c s whereSource
liftModel :: Model c s a -> Controller c s aSource