uni-events-2.2.2.1: uni events
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

Instances details
Ord key => Guard (EqMatch key) Source # 
Instance details

Defined in Events.EqGuard

Methods

nullGuard :: EqMatch key Source #

andGuard :: EqMatch key -> EqMatch key -> EqMatch key Source #