uni-events-2.2.0.0: Event handling for the uniform workbench

Events.GuardedChannels

Description

GuardedEvents implements guarded events for channels.

Documentation

data GuardedChannel guard value Source

type GQ guardQueue value = guardQueue (GuardInfo value)Source

type VQ valueQueue = valueQueue ValueInfoSource

newGuardedChannel :: HasGuardedChannel guardQueue valueQueue guard value => GQ guardQueue value -> VQ valueQueue -> IO (GuardedChannel guard value)Source

sneak :: Guard guard => GuardedChannel guard value -> GuardedEvent guard (Maybe value)Source

replace :: Guard guard => GuardedChannel guard value -> value -> GuardedEvent guard (Maybe value)Source

class HasEmpty xQueue whereSource

Methods

newEmpty :: IO (xQueue xData)Source

Instances

HasEmpty NullGuardQueue 
HasEmpty (NullValueQueue value) 
Ord key => HasEmpty (EqGuardQueue key) 
Ord key => HasEmpty (EqValueQueue key value) 

class HasRemove yQueue x y whereSource

Methods

remove :: yQueue yData -> x -> IO (Maybe (y, yData, IO (yQueue yData)), yQueue yData)Source

Instances

HasRemove NullGuardQueue value () 
HasRemove (NullValueQueue value) () value 
Ord key => HasRemove (EqGuardQueue key) (key, value) (EqMatch key) 
Ord key => HasRemove (EqValueQueue key value) (EqMatch key) (key, value) 

class HasAdd xQueue x whereSource

Methods

add :: xQueue xData -> x -> xData -> IO (xQueue xData, IO ())Source

Instances

HasAdd NullGuardQueue () 
HasAdd (NullValueQueue value) value 
Ord key => HasAdd (EqGuardQueue key) (EqMatch key) 
Ord key => HasAdd (EqValueQueue key value) (key, value) 

class (HasRemove yQueue x y, HasAdd xQueue x) => CanSendX xQueue yQueue x y Source

Instances

(HasRemove yQueue x y, HasAdd xQueue x) => CanSendX xQueue yQueue x y 

class (Guard guard, HasEmpty guardQueue, HasEmpty valueQueue, CanSendX guardQueue valueQueue guard value, CanSendX valueQueue guardQueue value guard) => HasGuardedChannel guardQueue valueQueue guard value Source

Instances

(Guard guard, HasEmpty guardQueue, HasEmpty valueQueue, CanSendX guardQueue valueQueue guard value, CanSendX valueQueue guardQueue value guard) => HasGuardedChannel guardQueue valueQueue guard value