WidgetRattus-0.3: An asynchronous modal FRP language for GUI programming
Safe HaskellSafe-Inferred
LanguageHaskell2010

WidgetRattus.Channels

Synopsis

Documentation

timer :: Int -> Box (O ()) Source #

timer n produces a delayed computation that ticks every n milliseconds. In particular mkSig (timer n) is a signal that produces a new value every milliseconds.

class Producer p a | p -> a where Source #

A type p satisfying Producer p a is essentially a signal that produces values of type a but it might not produce such values at each tick.

Methods

getCurrent :: p -> Maybe' a Source #

Get the current value of the producer if any.

getNext :: p -> (forall q. Producer q a => O q -> b) -> b Source #

Get the next state of the producer. Morally, the type of this method should be

getNext :: p -> (exists q. Producer q a => O q)

We encode the existential type using continuation-passing style.

Instances

Instances details
Producer p a => Producer (F p) a Source # 
Instance details

Defined in WidgetRattus.Future

Methods

getCurrent :: F p -> Maybe' a Source #

getNext :: F p -> (forall q. Producer q a => O q -> b) -> b Source #

Producer (SigF a) a Source # 
Instance details

Defined in WidgetRattus.Future

Methods

getCurrent :: SigF a -> Maybe' a Source #

getNext :: SigF a -> (forall q. Producer q a => O q -> b) -> b Source #

Producer p a => Producer (Box p) a Source # 
Instance details

Defined in WidgetRattus.Channels

Methods

getCurrent :: Box p -> Maybe' a Source #

getNext :: Box p -> (forall q. Producer q a => O q -> b) -> b Source #

Producer p a => Producer (O p) a Source # 
Instance details

Defined in WidgetRattus.Channels

Methods

getCurrent :: O p -> Maybe' a Source #

getNext :: O p -> (forall q. Producer q a => O q -> b) -> b Source #

Producer (Sig a) a Source # 
Instance details

Defined in WidgetRattus.Signal

Methods

getCurrent :: Sig a -> Maybe' a Source #

getNext :: Sig a -> (forall q. Producer q a => O q -> b) -> b Source #

chan :: C (Chan a) Source #

newtype C a Source #

Constructors

C 

Fields

Instances

Instances details
Applicative C Source # 
Instance details

Defined in WidgetRattus.Channels

Methods

pure :: a -> C a #

(<*>) :: C (a -> b) -> C a -> C b #

liftA2 :: (a -> b -> c) -> C a -> C b -> C c #

(*>) :: C a -> C b -> C b #

(<*) :: C a -> C b -> C a #

Functor C Source # 
Instance details

Defined in WidgetRattus.Channels

Methods

fmap :: (a -> b) -> C a -> C b #

(<$) :: a -> C b -> C a #

Monad C Source # 
Instance details

Defined in WidgetRattus.Channels

Methods

(>>=) :: C a -> (a -> C b) -> C b #

(>>) :: C a -> C b -> C b #

return :: a -> C a #

delayC :: O (C a) -> C (O a) Source #

wait :: Chan a -> O a Source #

data Chan a Source #