Source codeContentsIndex
Sink
Synopsis
class HasInvalidate source where
invalidate :: source -> IO ()
data SinkID
newSinkID :: IO SinkID
data Sink x
newSink :: (x -> IO ()) -> IO (Sink x)
newSinkGeneral :: SinkID -> (x -> IO ()) -> IO (Sink x)
putSink :: Sink x -> x -> IO Bool
coMapSink :: (y -> x) -> Sink x -> Sink y
class CanAddSinks sinkSource x delta | sinkSource -> x, sinkSource -> delta where
addNewSink :: sinkSource -> (delta -> IO ()) -> IO (x, Sink delta)
addNewSinkGeneral :: sinkSource -> (delta -> IO ()) -> SinkID -> IO (x, Sink delta)
addNewQuickSink :: sinkSource -> (delta -> IO ()) -> IO (x, Sink delta)
readContents :: sinkSource -> IO x
addNewQuickSinkGeneral :: sinkSource -> (delta -> IO ()) -> SinkID -> IO (x, Sink delta)
addOldSink :: sinkSource -> Sink delta -> IO x
data SinkSource x delta = forall sinkSource . (CanAddSinks sinkSource x delta) => SinkSource sinkSource
Documentation
class HasInvalidate source where
The HasInvalidate class represents information sources which can be told "No more, I'm not interested."
Methods
invalidate :: source -> IO ()
Instances
HasInvalidate SinkID
HasInvalidate (Sink x)
data SinkID
newSinkID :: IO SinkID
data Sink x
newSink :: (x -> IO ()) -> IO (Sink x)
Creates a new sink with its own SinkID
newSinkGeneral :: SinkID -> (x -> IO ()) -> IO (Sink x)
Creates a new sink with a given SinkID. This allows us to invalidate lots of sinks just by invalidating one sinkID.
putSink :: Sink x -> x -> IO Bool
coMapSink :: (y -> x) -> Sink x -> Sink y
Convert a sink from one type to another
class CanAddSinks sinkSource x delta | sinkSource -> x, sinkSource -> delta where
A class for things (in particular Broadcaster and VariableList) that output via sinks. Each sink source is supposed to have a unique x, containing a representation of the current value, and delta, containing the (incremental) updates which are put in the sink. Only the addOrdSink function must be defined by instances.
Methods
addNewSink :: sinkSource -> (delta -> IO ()) -> IO (x, Sink delta)
addNewSinkGeneral :: sinkSource -> (delta -> IO ()) -> SinkID -> IO (x, Sink delta)
addNewQuickSink :: sinkSource -> (delta -> IO ()) -> IO (x, Sink delta)
readContents :: sinkSource -> IO x
addNewQuickSinkGeneral :: sinkSource -> (delta -> IO ()) -> SinkID -> IO (x, Sink delta)
addOldSink :: sinkSource -> Sink delta -> IO x
Instances
CanAddSinks (Broadcaster x delta) x delta
CanAddSinks (SinkSource x delta) x delta
(Ord key) => CanAddSinks (VariableMap key elt) (VariableMapData key elt) (VariableMapUpdate key elt)
(Ord key) => CanAddSinks (VariableMapSet key elt element) [element] (VariableSetUpdate element)
(HasKey x key) => CanAddSinks (VariableSet x) [x] (VariableSetUpdate x)
data SinkSource x delta
Constructors
forall sinkSource . (CanAddSinks sinkSource x delta) => SinkSource sinkSource
Instances
CanAddSinks (SinkSource x delta) x delta
Produced by Haddock version 0.3