netwire-5.0.3: Functional reactive programming library

Copyright(c) 2013 Ertugrul Soeylemez
LicenseBSD3
MaintainerErtugrul Soeylemez <es@ertes.de>
Safe HaskellNone
LanguageHaskell2010

Control.Wire.Unsafe.Event

Contents

Description

 

Synopsis

Events

data Event a Source #

Denotes a stream of values, each together with time of occurrence. Since Event is commonly used for functional reactive programming it does not define most of the usual instances to protect continuous time and discrete event occurrence semantics.

Constructors

Event a 
NoEvent 

Instances

Functor Event Source # 

Methods

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

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

Semigroup a => Semigroup (Event a) Source # 

Methods

(<>) :: Event a -> Event a -> Event a #

sconcat :: NonEmpty (Event a) -> Event a #

stimes :: Integral b => b -> Event a -> Event a #

Semigroup a => Monoid (Event a) Source # 

Methods

mempty :: Event a #

mappend :: Event a -> Event a -> Event a #

mconcat :: [Event a] -> Event a #

NFData a => NFData (Event a) Source # 

Methods

rnf :: Event a -> () #

Helper functions

event :: b -> (a -> b) -> Event a -> b Source #

Fold the given event.

merge :: (a -> a -> a) -> Event a -> Event a -> Event a Source #

Merge two events using the given function when both occur at the same time.

occurred :: Event a -> Bool Source #

Did the given event occur?

onEventM :: Monad m => (a -> m b) -> Wire s e m (Event a) (Event b) Source #

Each time the given event occurs, perform the given action with the value the event carries. The resulting event carries the result of the action.

  • Depends: now.