Safe Haskell | None |
---|---|
Language | Haskell98 |
Examples is meant to contain examples of using events which are too small to go into their own module.
- data EventSet a
- emptyEventSet :: EventSet a
- addToEventSet :: EventSet a -> Event a -> EventSet a
- fromEventSet :: EventSet a -> Event (a, EventSet a)
- isEmptyEventSet :: EventSet a -> Bool
- watch :: Event a -> IO (Event a, IO ())
- spawnRepeatedEvent :: Event () -> IO (IO ())
Documentation
emptyEventSet :: EventSet a Source
addToEventSet :: EventSet a -> Event a -> EventSet a Source
fromEventSet :: EventSet a -> Event (a, EventSet a) Source
isEmptyEventSet :: EventSet a -> Bool Source
watch :: Event a -> IO (Event a, IO ()) Source
watch is used for events like mouse motion events where if we can't find time we don't want them queued. The event returned waits until the original event next happens and returns it. A worker thread is needed to run this; the attached action should be used to stop that thread when we are no longer interested.
spawnRepeatedEvent :: Event () -> IO (IO ()) Source
spawnRepeatedEvent concurrently syncs on the event until the given action is used; it is somewhat safer than spawnEvent. It also never interrupts the handler event attached to the event.