essence-of-live-coding-0.2.3: General purpose live coding framework

Safe HaskellSafe
LanguageHaskell2010

LiveCoding.Cell.Util

Contents

Synopsis

Documentation

sumFrom :: Monad m => Integer -> Cell m Integer Integer Source #

Sum all past inputs, starting by the given number

count :: Monad m => Cell m a Integer Source #

Count the number of ticks, starting at 0

foldC :: (Data b, Monad m) => (a -> b -> b) -> b -> Cell m a b Source #

Accumulate all incoming data, using the given fold function and start value. For example, if foldC f b receives inputs a0, a1,... it will output b, f a0 b, f a1 $ f a0 b, and so on.

Debugging utilities

printTime :: MonadIO m => String -> m () Source #

Print the current UTC time, prepended with the first 8 characters of the given message.

printTimeC :: MonadIO m => String -> Cell m () () Source #

Like printTime, but as a cell.