Safe Haskell | None |
---|---|
Language | Haskell98 |
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.
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
.
fromCircuit :: Circuit era i o -> UICircuit item uiBackend era i o Source #
Converts an ordinary circuit into a user interface circuit that contains no items.
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.