| Copyright | Copyright 2024 Shea Levy. |
|---|---|
| License | Apache-2.0 |
| Maintainer | shea@shealevy.com |
| Safe Haskell | Safe-Inferred |
| Language | GHC2021 |
Observe.Event.Backend.Data
Description
This module provides the DataEventBackend EventBackend for consuming events
by representing them as ordinary Haskell data.
Synopsis
- newDataEventBackend :: forall m selector. (PrimMonad m, ParametricFunctor m) => m (DataEventBackend m selector)
- getEvents :: PrimMonad m => DataEventBackend m selector -> m (Seq (Maybe (DataEvent selector)))
- data DataEvent selector = forall f.DataEvent {}
- data Selectors selector field where
- data DataEventBackend m selector
Documentation
newDataEventBackend :: forall m selector. (PrimMonad m, ParametricFunctor m) => m (DataEventBackend m selector) Source #
Allocate a new DataEventBackend
getEvents :: PrimMonad m => DataEventBackend m selector -> m (Seq (Maybe (DataEvent selector))) Source #
Read the events that have been emitted using the DataEventBackend
data DataEvent selector Source #
A representation of an event.
Constructors
| forall f. DataEvent | |
Fields
| |
data Selectors selector field where Source #
A nested sequence of selectors, starting from a
given root selector family and ending in a selector
selecting a given field type.
For example, given:
data FooSelector :: Type -> Type where Foo :: FooSelector FooField data FooField type instance SubSelector FooField = BarSelector data BarSelector :: Type -> Type where Bar :: BarSelector BarField data BarField type instance SubSelector BarField = NoEventsSelector
Then Leaf Foo is a sequence Selectors picking out an Event with field
type FooField, and Foo :/ Leaf Bar is a sequence of Selectors picking out
an Event with field type BarField underneath an Event with field type FooField.
See the selector and field documentation for more details.
data DataEventBackend m selector Source #
An EventBackend for consuming events by representing them as
ordinary Haskell data.
Create a new one with newDataEventBackend. Get the event data with getEvents.