hsc3-0.20: Haskell SuperCollider
Safe HaskellSafe-Inferred
LanguageHaskell2010

Sound.Sc3.Common.Monad

Description

Common Monad variations.

Synopsis

Documentation

repeatM :: Monad m => m t -> m [t] Source #

mvoid :: Monad m => m a -> m () Source #

This is the same function as Control.Monad.void, which however hugs does not know of.

repeatM_ :: Monad m => m t -> m () Source #

void of repeatM.

composeM :: Monad m => [a -> m a] -> a -> m a Source #

Right to left compositon of Monad functions.

fmap (== 7) (composeM [return . (+ 1),return . (* 2)] 3)
fmap (== 8) (composeM [return . (* 2),return . (+ 1)] 3)

chainM :: Monad m => Int -> (b -> m b) -> b -> m b Source #

Feed forward composition of n applications of f.

fmap (== 3) (chainM 3 (return . (+ 1)) 0)