Safe Haskell | None |
---|---|
Language | Haskell98 |
In GuardedEvents we extend the notion of PrimEvents to allow Guarded Events, which can be guarded with the new (|>) operator. GuardedChannels will implement guarded events on channels, which will hopefully be the only guarded event we will ever need.
Synopsis
- data Guard guard => GuardedEvent guard a = GuardedEvent !(guard -> Event a) !guard
- class Guard guard => HasGuard eventType guard where
- (|>) :: eventType a -> guard -> eventType a
- class Guard guard where
- class HasListen chan where
- listen :: Guard guard => chan guard a -> GuardedEvent guard a
Documentation
data Guard guard => GuardedEvent guard a Source #
A GuardedEvent guard a represents a source of values of type a, which may be selected from according to guards of type guard.
GuardedEvent !(guard -> Event a) !guard |
Instances
Guard guard => HasEvent (GuardedEvent guard) Source # | |
Defined in Events.GuardedEvents toEvent :: GuardedEvent guard a -> Event a Source # | |
Guard guard => HasGuard (GuardedEvent guard) guard Source # | |
Defined in Events.GuardedEvents (|>) :: GuardedEvent guard a -> guard -> GuardedEvent guard a Source # |
class Guard guard => HasGuard eventType guard where Source #
Instances
Guard guard => HasGuard (GuardedEvent guard) guard Source # | |
Defined in Events.GuardedEvents (|>) :: GuardedEvent guard a -> guard -> GuardedEvent guard a Source # |
class Guard guard where Source #
A Guard represents some condition on a value which we impose on a channel, selecting those values we are interested in.
class HasListen chan where Source #
Class of those channels which have guarded events.
listen :: Guard guard => chan guard a -> GuardedEvent guard a Source #
Instances
HasListen GuardedChannel Source # | |
Defined in Events.GuardedChannels listen :: Guard guard => GuardedChannel guard a -> GuardedEvent guard a Source # |