frame-0.1: A simple web framework.

Frame.Model

Description

High level model helpers

Synopsis

Documentation

class MonadIO m => FrameIO m Source

Instances

MonadIO m => FrameIO m 

liftIO :: MonadIO m => forall a. IO a -> m a

fieldNameSource

Arguments

:: String

Table name

-> String

Attribute name

-> String

''TableName.attributeName''

Convenience function for creating a qualified attribute name

tableName :: Table t -> TableName

Get the name of a table.

(-.-)Source

Arguments

:: Table r

Table

-> Attr f a

Attribute

-> String

''TableName.attributeName''

Convenience function for a stringed representation fo a table and attribute

runSource

Arguments

:: FrameModel m 
=> (Database -> m a)

The function that requires a database

-> m a

The executed result

Execute a database function against the DB

merge :: FrameModel m => m (Maybe Fields) -> m (Maybe Fields)Source

Take the fields updated by some model action and merge them in to the state

postedSource

Arguments

:: FrameModel m 
=> (Fields -> m a)

The computation to run

-> m Bool

Did the computation succeed?

Should a form have been posted and all of the fields validate, run some computation which maps fields to a model (with an empty return type)