Idris2Doc : Web.MVC.Controller

Web.MVC.Controller

(source)

Reexports

importpublic Control.Monad.State
importpublic Web.MVC.Cmd

Definitions

0Prog : Type->Type->Type->Type
  A `Prog` controls some state of type `s` acting on events of
type `e`.

Based on an event and the current state, the controller produces a new
state and a result (typically a command), which usually updates the
UI in such a way that it can fire more events.

Totality: total
Visibility: public export
0Controller : Type->Type->Type
Totality: total
Visibility: public export
(<$$>) : (x->y) ->States (Cmdx) ->States (Cmdy)
Totality: total
Visibility: export
Fixity Declaration: infixr operator, level 4
map2 : (x->y) ->States (Cmdx) ->States (Cmdy)
Totality: total
Visibility: export
direct : Monoidt=>Progeet
  On an event, replaces the current state with the event's
value without emitting a command.

Totality: total
Visibility: export
directM : Monoidt=>Proge (Maybee) t
  Same as `direct` but for optional states.

Totality: total
Visibility: export
displayEv : (s->Cmdt) ->Progss (Cmdt)
  A controller that replaces the state with the current event
and display the new state.

Totality: total
Visibility: export
updateDisp : (e->s->s) -> (e->s->Cmdt) ->Proges (Cmdt)
  Update the state with the given function, the run a command
derived from the new state.

Totality: total
Visibility: export
dataProgs : ListType->ListType->Type
Totality: total
Visibility: public export
Constructors:
Nil : Progs [] []
(::) : Proges (Cmde) ->Progsesss->Progs (e::es) (s::ss)
progs : Progsesss->Controller (HSumes) (HListss)
  A list of controllers can be converted to a controller over
a heterogeneous sum as the event type and a heterogeneous list
as the state type.

Totality: total
Visibility: export
run : Proges (Cmde) ->e->s->IO ()
Visibility: export
recordEditor : Type->Type->Type->Type->Type
  An `Editor` describes how to "pop-up" new interactive DOM elements that
typically serve as a form of (validated) user input. It consists of a
`Controller` for the interactive element(s), but also describes an initial
view to display and command to emit, based on the current state.

An editor and its corresponding widgets can be something simple like a
text input field or a `<select>` element, or it can be highly complex
like a canvas and a group of DOM elements for editing molecules.

Since an `Editor` describes a set of DOM elements that can potentially
appear several times in a web page (for instance, when editing a list of
values), its functions take a `DomID` as additional input, to distinguish
between the different versions of the widget that are around.

@i : The ID type used to identify DOM elements

@st : The type used to internally store the current widget state

@ev : The event type the widget fires.

@new : The type of data we can extract from the widget's internal state.

Totality: total
Visibility: public export
Constructor: 
E : (i->Controllerevst) -> (i->st->Nodeev) -> (i->st->Cmdev) -> (st->EitherStringnew) -> (Maybenew->st) ->Editoristevnew

Projections:
.ctrl : Editoristevnew->i->Controllerevst
  Update the inner state based on the current event.
.init : Editoristevnew->i->st->Cmdev
  The initial command use to properly setup the view. This is used
for initial validation or for drawing molecules to the canvas when
editing starts. It is invoked after setting up the view.
.stToNew : Editoristevnew->st->EitherStringnew
  Try to convert the current state to a value of type `new` we can
send to the server. This implements client-side validation, therefore,
it returns an `Either`.
.toState : Editoristevnew->Maybenew->st
  Create an initial state from an optional value of type `new`
.view : Editoristevnew->i->st->Nodeev
  Create a widget from a unique identifier and the initial state.
.ctrl : Editoristevnew->i->Controllerevst
  Update the inner state based on the current event.

Totality: total
Visibility: public export
ctrl : Editoristevnew->i->Controllerevst
  Update the inner state based on the current event.

Totality: total
Visibility: public export
.view : Editoristevnew->i->st->Nodeev
  Create a widget from a unique identifier and the initial state.

Totality: total
Visibility: public export
view : Editoristevnew->i->st->Nodeev
  Create a widget from a unique identifier and the initial state.

Totality: total
Visibility: public export
.init : Editoristevnew->i->st->Cmdev
  The initial command use to properly setup the view. This is used
for initial validation or for drawing molecules to the canvas when
editing starts. It is invoked after setting up the view.

Totality: total
Visibility: public export
init : Editoristevnew->i->st->Cmdev
  The initial command use to properly setup the view. This is used
for initial validation or for drawing molecules to the canvas when
editing starts. It is invoked after setting up the view.

Totality: total
Visibility: public export
.stToNew : Editoristevnew->st->EitherStringnew
  Try to convert the current state to a value of type `new` we can
send to the server. This implements client-side validation, therefore,
it returns an `Either`.

Totality: total
Visibility: public export
stToNew : Editoristevnew->st->EitherStringnew
  Try to convert the current state to a value of type `new` we can
send to the server. This implements client-side validation, therefore,
it returns an `Either`.

Totality: total
Visibility: public export
.toState : Editoristevnew->Maybenew->st
  Create an initial state from an optional value of type `new`

Totality: total
Visibility: public export
toState : Editoristevnew->Maybenew->st
  Create an initial state from an optional value of type `new`

Totality: total
Visibility: public export
newIso : Iso'n1n2->Editoristevn1->Editoristevn2
  View an editor through an isomorphism.

Totality: total
Visibility: export
noInit : i->s->Cmde
  Utility for editors without initial command.

Totality: total
Visibility: export
toNewM : Editoristevnew->Maybest->Maybenew
  Tries to convert the current (optional) state of an editor to
an updated value.

Totality: total
Visibility: export
newP : Prism'ts->Editoristevs->Editoristevt
  Views the `new` values of an editor through a prism.

Totality: total
Visibility: export
dummy : n->Editori () Voidn
  A dummy `Editor` for uneditable values.

Totality: total
Visibility: public export
elemChildren : CasttDomID=>t->List (Nodee) ->Cmde
Totality: total
Visibility: export
elemChild : CasttDomID=>t->Nodee->Cmde
Totality: total
Visibility: export
elemAppend : CasttDomID=>t->Nodee->Cmde
Totality: total
Visibility: export
elemPrepend : CasttDomID=>t->Nodee->Cmde
Totality: total
Visibility: export
clearElem : CasttDomID=>t->Cmde
Totality: total
Visibility: export
removeElem : CasttDomID=>t->Cmde
Totality: total
Visibility: export
replaceElem : CasttDomID=>t->Nodee->Cmde
Totality: total
Visibility: export
btnAttr : CasttDomID=>t->AttributeButtone->Cmde
Totality: total
Visibility: export