UISF-0.1.0.0: Library for Arrowized Graphical User Interfaces.

Stabilityexperimental
Maintainerdwc@cs.yale.edu
Safe HaskellNone

FRP.UISF.Types.MSF

Contents

Description

MSF is a monadic signal function.

Synopsis

Documentation

data MSF m a b Source

The MSF data type describes a monadic signal function. Essentially, it is a Kleisli automaton, but we define it explicitly here.

Constructors

MSF 

Fields

msfFun :: a -> m (b, MSF m a b)
 

Instances

ArrowCircuit UISF 
ArrowTime UISF 
Monad m => Arrow (MSF m) 
Monad m => ArrowChoice (MSF m) 
MonadFix m => ArrowLoop (MSF m) 
Monad m => Category (MSF m) 
MonadFix m => ArrowCircuit (MSF m) 

MSF Constructors

The source, sink, and pipe functions allow one to lift a monadic action to the MSF data type.

source :: Monad m => m c -> MSF m () cSource

sink :: Monad m => (b -> m ()) -> MSF m b ()Source

pipe :: Monad m => (b -> m c) -> MSF m b cSource

The sourceE, sinkE, and pipeE functions allow one to lift a monadic action to the MSF data type in event form.

sourceE :: Monad m => m c -> MSF m (Maybe ()) (Maybe c)Source

sinkE :: Monad m => (b -> m ()) -> MSF m (Maybe b) (Maybe ())Source

pipeE :: Monad m => (b -> m c) -> MSF m (Maybe b) (Maybe c)Source

initialAction :: Monad m => m x -> (x -> MSF m a b) -> MSF m a bSource

This function first performs a monadic action and then uses the result of that action to complete the MSF.

listSource :: Monad m => [c] -> MSF m () cSource

This function creates a MSF source based on an infinite list.

Running MSF

stepMSF :: Monad m => MSF m a b -> [a] -> m [b]Source

This steps through the given MSF using the [a] as inputs. The result is [b] in the monad.

stepMSF' :: Monad m => MSF m a b -> [a] -> m ([b], MSF m a b)Source

This is the same as stepMSF but additionally returns the next computation.

data Stream m b Source

The stream data type is used to "stream" the results of running an MSF.

Constructors

Stream 

Fields

stream :: m (b, Stream m b)
 

streamMSF :: Monad m => MSF m a b -> [a] -> Stream m bSource

Given an input list of values, this produces a stream of results that can be unwound as necessary.

runMSF :: Monad m => a -> MSF m a b -> m bSource

This function runs the MSF on a single value.

runMSF' :: Monad m => MSF m () b -> m bSource

This function runs an MSF that takes unit input for a single value.