timeless-1.0.1.2: An Arrow based Functional Reactive Programming library

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

FRP.Timeless.Internal.Prefab.Primitive

Contents

Description

This module contains the lowest level primitives of timeless, directly working with the Signal arrow. Try not to use them as they tend to be very hard to grasp. Use them only when building a new FRP framework.

Understand that using Signal directly can be difficult to reason about

Synopsis

Basic Signals

mkEmpty :: Signal m a b Source #

Make a signal that inhibits forever

mkId :: Signal m a a Source #

The Identity Signal

mkConst :: Maybe b -> Signal m a b Source #

Make a constant Signal

mkPure :: (a -> (Maybe b, Signal m a b)) -> Signal m a b Source #

Make a pure stateful signal from given transition function

mkGen :: Monad m => (a -> m (Maybe b, Signal m a b)) -> Signal m a b Source #

Make a stateful signal from given (Monadic) transition function

Pure Signals

Signals

mkPure_ :: (a -> Maybe b) -> Signal m a b Source #

Make a pure stateless signal from given function

mkSF :: (a -> (b, Signal m a b)) -> Signal m a b Source #

Make a pure stateful signal from given signal function

mkSF_ :: (a -> b) -> Signal m a b Source #

Make a pure stateless signal from given signal function

mkSW_ :: b -> (b -> a -> b) -> Signal m a b Source #

Make a stateful wire from chained state transition function. Notice that the output will always be the new value

Monadic Signals

mkGen_ :: Monad m => (a -> m (Maybe b)) -> Signal m a b Source #

Make a stateless signal from given function

Kleisli Signals

mkKleisli_ :: Monad m => (a -> m b) -> Signal m a b Source #

Make a stateless signal from Kleisli function

mkSK_ :: Monad m => b -> (b -> a -> m b) -> Signal m a b Source #

Make a stateful signal from Kleisli function

mkConstM :: Monad m => m b -> Signal m a b Source #

Make a monadic constant wire

mkActM :: Monad m => m b -> Signal m a b Source #

Make a monadic action wire, alias for mkConstM

Special signals

delay :: a -> Signal m a a Source #