keid-frp-banana
Safe HaskellSafe-Inferred
LanguageGHC2021

Engine.ReactiveBanana.Widget

Synopsis

Documentation

data Widget e b Source #

A composable pair of actions for planning and running stages.

Constructors

Widget 

Fields

Instances

Instances details
Bifunctor Widget Source #

Widget is covariant functor over its "output" events and behavior.

Instance details

Defined in Engine.ReactiveBanana.Widget

Methods

bimap :: (a -> b) -> (c -> d) -> Widget a c -> Widget b d #

first :: (a -> b) -> Widget a c -> Widget b c #

second :: (b -> c) -> Widget a b -> Widget a c #

Functor (Widget e) Source #

Widget is covariant functor over its "output" behavior.

Instance details

Defined in Engine.ReactiveBanana.Widget

Methods

fmap :: (a -> b) -> Widget e a -> Widget e b #

(<$) :: a -> Widget e b -> Widget e a #

Semigroup b => Semigroup (Widget Void b) Source # 
Instance details

Defined in Engine.ReactiveBanana.Widget

Methods

(<>) :: Widget Void b -> Widget Void b -> Widget Void b #

sconcat :: NonEmpty (Widget Void b) -> Widget Void b #

stimes :: Integral b0 => b0 -> Widget Void b -> Widget Void b #

Semigroup b => Semigroup (Widget () b) Source # 
Instance details

Defined in Engine.ReactiveBanana.Widget

Methods

(<>) :: Widget () b -> Widget () b -> Widget () b #

sconcat :: NonEmpty (Widget () b) -> Widget () b #

stimes :: Integral b0 => b0 -> Widget () b -> Widget () b #

type Widget' a = Widget a a Source #

A Widget that doesn't transform the event it produces.

wrap :: (Event e -> Event i) -> (Behavior b -> Behavior c) -> (IO () -> IO ()) -> Widget e b -> Widget i c Source #

Like bimap, but wraps draw function too.

Parent draw can be called at wrapper discretion.

data Instance e b Source #

Constructors

Instance 

Fields

Instances

Instances details
Functor (Instance e) Source # 
Instance details

Defined in Engine.ReactiveBanana.Widget

Methods

fmap :: (a -> b) -> Instance e a -> Instance e b #

(<$) :: a -> Instance e b -> Instance e a #

Combinators

drawB :: Behavior b -> IO () -> Widget Void b Source #

A widget without events of its own, sampling external behavior.

draw_ :: IO () -> Widget Void () Source #

collectB :: Traversable t => t (MomentIO (Widget e b)) -> MomentIO (Widget () (t b)) Source #

clumpWithB :: (lb -> rb -> b) -> Widget le lb -> Widget re rb -> Widget () b Source #

clumpWith :: (ae -> ce) -> (be -> ce) -> (ae -> be -> ce) -> (ab -> bb -> cb) -> Widget ae ab -> Widget be bb -> Widget ce cb Source #

These

clump :: Widget ae ab -> Widget b bb -> Widget (These ae b) (ab, bb) Source #

clumpB :: (ab -> bb -> b) -> Widget ae ab -> Widget be bb -> Widget (These ae be) b Source #

attachLeft :: Widget ae ab -> Widget be bb -> Widget ae ab Source #

attachRight :: Widget ae ab -> Widget be bb -> Widget be bb Source #