monomer-1.2.0.0: A GUI library for writing native Haskell applications.
Copyright(c) 2018 Francisco Vallarino
LicenseBSD-3-Clause (see the LICENSE file)
Maintainerfjvallarino@gmail.com
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Monomer.Main.Core

Description

Core glue for running an application.

Synopsis

Documentation

type AppEventResponse s e = EventResponse s e s () Source #

Type of response an App event handler can return, with s being the model and e the user's event type.

type AppEventHandler s e Source #

Arguments

 = WidgetEnv s e

The widget environment.

-> WidgetNode s e

The root node of the application.

-> s

The application's model.

-> e

The event to handle.

-> [AppEventResponse s e]

The list of requested actions.

Type of an App event handler.

type AppUIBuilder s e = UIBuilder s e Source #

Type of the function responsible of creating the App UI.

startApp Source #

Arguments

:: (Eq s, WidgetModel s, WidgetEvent e) 
=> s

The initial model.

-> AppEventHandler s e

The event handler.

-> AppUIBuilder s e

The UI builder.

-> [AppConfig e]

The application config.

-> IO ()

The application action.

Runs an application, creating the UI with the provided function and initial model, handling future events with the event handler.

Control will not be returned until the UI exits. This needs to be ran in the main thread if using macOS.