grapefruit-records-0.0.0.0: A record systemSource codeContentsIndex
FRP.Grapefruit.Record.Context
Contents
Context connector records
Field family instance for context connector records
Description

This module provides context connector records.

A context connector record is a record of connectors (consumers or producers) which depend on some data, called the context.

Synopsis
type ContextConsumerRecord context record = ContextConnectorRecord context Consumer record
type ContextProducerRecord context record = ContextConnectorRecord context Producer record
type ContextConnectorRecord context connector record = record (ContextConnectorStyle context connector)
data ContextConnectorStyle context connector
consume :: Record record => ContextConsumerRecord context record -> ReaderArrow context (Circuit era) (SignalRecord era record) ()
produce :: Record record => ContextProducerRecord context record -> ReaderArrow context (Circuit era) () (SignalRecord era record)
app :: Record record => ContextConnectorRecord context connector record -> context -> ConnectorRecord connector record
data family (name ::: signalOfVal) style :: *
Context connector records
type ContextConsumerRecord context record = ContextConnectorRecord context Consumer recordSource
Records which contain functions from contexts to consumers as values.
type ContextProducerRecord context record = ContextConnectorRecord context Producer recordSource
Records which contain functions from contexts to producers as values.
type ContextConnectorRecord context connector record = record (ContextConnectorStyle context connector)Source
Records which contain functions from contexts to connectors (consumers or producers) as values.
data ContextConnectorStyle context connector Source

The context consumer and context producer record styles.

ContextConnectorStyle context Consumer is the style of context consumer records with context context and ContextConnectorStyle context Producer is the style of context producer records with context context. Fields of context connector style records have the form name ::~~ connectorGenerator.

consume :: Record record => ContextConsumerRecord context record -> ReaderArrow context (Circuit era) (SignalRecord era record) ()Source
Converts a record of context consumers into a reader arrow which consumes a corresponding record of signals. The concrete context has to be provided as the environment of the reader arrow.
produce :: Record record => ContextProducerRecord context record -> ReaderArrow context (Circuit era) () (SignalRecord era record)Source
Converts a record of context producers into a reader arrow which produces a corresponding record of signals. The concrete context has to be provided as the environment of the reader arrow.
app :: Record record => ContextConnectorRecord context connector record -> context -> ConnectorRecord connector recordSource
Applies all values of a context connector record to a given context to form an ordinary context record.
Field family instance for context connector records
data family (name ::: signalOfVal) style :: *Source

The family of record fields.

Each instance of it matches arbitrary name parameters and all signalOfVal parameters which are of the form signal `Of` val. The actual choice of the instance depends only on the style parameter. The structure of fields of a specific style is documented together with the respective style type.

Produced by Haddock version 2.4.2