grapefruit-ui-0.1.0.4: Declarative user interface programming

Safe HaskellNone

Graphics.UI.Grapefruit.Circuit

Description

This module provides support for user interface circuits.

UI circuits are systems of UI items (for example, widgets). They are similar to ordinary circuits as provided by FRP.Grapefruit.Circuit but have the additional feature of providing parts of user interfaces.

Synopsis

Documentation

data UICircuit item uiBackend era i o Source

The type of user interface circuits.

The item parameter is a phantom parameter which says which kind of items the circuit contains. It should be an instance of Item.

Instances

UIComp UICircuit 
Arrow (UICircuit item uiBackend era) 
ArrowLoop (UICircuit item uiBackend era) 
Category (UICircuit item uiBackend era) 

fromCircuit :: Circuit era i o -> UICircuit item uiBackend era i oSource

Converts an ordinary circuit into a user interface circuit that contains no items.

runSource

Arguments

:: UIBackend uiBackend 
=> uiBackend

the user interface backend to use

-> (forall era. UICircuit Window uiBackend era i (DSignal era o))

the circuit to run

-> i

the input of the ciruit

-> IO o

an action running the circuit and returning the value of the output signal’s first occurence

Runs a user interface circuit.

run quits when the output signal of the circuit has a first occurence. The universal quantification of the circuit’s era parameter ensures that the circuit does not use signals which are produced outside the circuit and therefore avoids era mismatches.