hsc3-0.17: Haskell SuperCollider

Sound.SC3.Common.Monad

Description

Common Monad variations.

Monad

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

sequence of repeat

sequence

repeat

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

void of repeatM.

void

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)