elerea-2.7.0.2: A minimalistic FRP library

Safe HaskellSafe-Inferred

FRP.Elerea.Simple.Pure

Contents

Description

This module contains the reference implementation for the pure subset of the simple variant of Elerea. I/O embedding is substituted by conversion from and to lists.

Synopsis

The signal abstraction

type Signal a = Int -> aSource

type SignalGen a = Int -> aSource

Inputs and outputs

toList :: Signal a -> [a]Source

Basic building blocks

until :: (a -> Bool) -> (a -> a) -> a -> a

until p f yields the result of applying f until p holds.

Derived combinators

stateful :: a -> (a -> a) -> SignalGen (Signal a)Source

transfer :: a -> (t -> a -> a) -> Signal t -> SignalGen (Signal a)Source

transfer2 :: a -> (t1 -> t2 -> a -> a) -> Signal t1 -> Signal t2 -> SignalGen (Signal a)Source

transfer3 :: a -> (t1 -> t2 -> t3 -> a -> a) -> Signal t1 -> Signal t2 -> Signal t3 -> SignalGen (Signal a)Source

transfer4 :: a -> (t1 -> t2 -> t3 -> t4 -> a -> a) -> Signal t1 -> Signal t2 -> Signal t3 -> Signal t4 -> SignalGen (Signal a)Source