timeless-1.0.0.0: An Arrow based Functional Reactive Programming library

Copyright(c) Ertugrul Soeylemez 2013
(c) Rongcui Dong 2015
LicenseBSD3
MaintainerRongcui Dong <karl_1702@188.com>
Safe HaskellSafe
LanguageHaskell2010

FRP.Timeless

Contents

Description

 

Synopsis

Reexports

High level FRP

type Stream a b = Signal IO (Maybe a) (Maybe b) Source #

A Stream of discrete events.

type Cell a b = Signal IO a b Source #

A Cell of continuous value.

Cells must not be inhibited

type StreamCell a b = Signal IO (Maybe a) b Source #

FRP Primitives

sourceC :: IO b -> CellSource b Source #

sinkC :: (a -> IO ()) -> CellSink a Source #

sourceS :: IO (Maybe b) -> StreamSource b Source #

sinkS :: (a -> IO ()) -> StreamSink a Source #

mergeS :: ((a, a) -> a) -> Signal IO (Maybe a, Maybe a) (Maybe a) Source #

Merges two Stream. When simultaneous, use the merge function

orElse :: Signal IO (Maybe b, Maybe b) (Maybe b) Source #

Merges two Stream with precedence to first.

hold :: a -> StreamCell a a Source #

Holds a discrete value to be continuous. An initial value must be given

filterS :: (a -> Bool) -> Stream a a Source #

Filters stream of event. TODO: In future, might implement Foldable

snapshot :: ((a, b) -> c) -> Signal IO (Maybe a, b) (Maybe c) Source #

Takes a snapshot of b when an event a comes. Meanwhile, transform the Stream with the Cell value

sample :: Signal IO (Maybe a, b) (Maybe b) Source #

This conviniently just samples a Cell

state :: s' -> ((a, s') -> s') -> Signal IO (Maybe a) s' Source #

A state block, updates on event. Note that this can be constructed with Signal directly, but we are using primitives instead, for easy reasoning

zipS :: Signal m (Maybe a, Maybe b) (Maybe (a, b)) Source #

zipS3 :: Signal m (Maybe a, Maybe b, Maybe c) (Maybe (a, b, c)) Source #

zipS4 :: Signal m (Maybe a, Maybe b, Maybe c, Maybe d) (Maybe (a, b, c, d)) Source #

zipS5 :: Signal m (Maybe a, Maybe b, Maybe c, Maybe d, Maybe e) (Maybe (a, b, c, d, e)) Source #

zipS6 :: Signal m (Maybe a, Maybe b, Maybe c, Maybe d, Maybe e, Maybe f) (Maybe (a, b, c, d, e, f)) Source #

zipS7 :: Signal m (Maybe a, Maybe b, Maybe c, Maybe d, Maybe e, Maybe f, Maybe g) (Maybe (a, b, c, d, e, f, g)) Source #

External