fpco-api-1.2.0.5: Simple interface to the FP Complete IDE API.

Safe HaskellSafe-Inferred
LanguageHaskell2010

FP.API.Signal

Description

A very minimal library for broadcasting events to listeners.

Synopsis

Documentation

data Signal m a Source

Constructors

Signal (IORef (IntMap (a -> m ()))) 

sendSignal :: MonadIO m => Signal m a -> a -> m () Source

subscribeSignal :: Signal m a -> (IO () -> a -> m ()) -> IO (IO ()) Source

blockOnSignal :: MonadIO m => Maybe Int -> Signal m a -> (a -> m (Maybe b)) -> IO (Maybe b) Source

Block, watching for a particular value (indicated by Just). Once a Just value is seen, stop subscribing, and return the value. The Maybe Int argument specifies an optional timeout in microseconds. If the function instead times out, then Nothing is yielded.