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

Safe HaskellNone
LanguageHaskell98

Events.EqGuard

Description

Here we create a simple guarded queue which allows guarding by equality according to an ordered key. Thus guards have three values, match anything, match nothing, and match this value.

To simplify the implementation, we specify that an Eq match has higher priority than a MatchAnything match, and when we must choose between values for MatchAnything, do not necessarily choose the first (more likely the one with the lowest key value). But we do respect FIFO order when only Eq guards are involved.

Documentation

type EqGuardedChannel key value = GuardedChannel (EqMatch key) (key, value) Source

data EqMatch key Source

Constructors

Eq !key 
EqMatchAny 
EqMatchNone 

Instances

Ord key => Guard (EqMatch key)