Main

The Elm architecture

The usual Elm Architecture is used, except that Effect msg are returned instead of Cmd msg, thanks to Effect.application.

type alias Model =
{ env : Env
, session : Session
, page : Page
}

The application model, storing the current session (guest or authenticated), an environment and the current page.

type Msg
= Ignored String
| ChangedUrl Url
| ClickedLink UrlRequest
| GotTimeZone Zone
| GotSession Session
| GotPageMsg Msg

The top level application Msg type.

init : Session -> Url -> Key -> ( Model, Effect Msg )

Initialize the application.

view : Model -> Document Msg

Turns the model into an HTML page.

update : Msg -> Model -> ( Model, Effect Msg )

Turns messages into effects and model update.

Main

main : Program Value Model Msg

The application entry point. It will receive the session from local storage as a flag if present.