grapefruit-records-0.1.0.5: A record system for Functional Reactive Programming

Safe HaskellNone

Data.Record.Signal.Context

Contents

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

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.

type ContextConnectorStyle context connector = ContextStyle context (ConnectorStyle connector)Source

consume :: Record SignalKind 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 SignalKind 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.