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

Safe HaskellNone
LanguageHaskell98

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 ValueInfo Source

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 where Source

Methods

newEmpty :: IO (xQueue xData) Source

class HasRemove yQueue x y where Source

Methods

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

class HasAdd xQueue x where Source

Methods

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

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