Safe Haskell | Safe-Inferred |
---|---|

Language | Haskell98 |

Functions to make writing `Applicative`

and `Monad`

UGen graphs
less clumsy.

- (.+) :: (Functor f, Num a) => f a -> a -> f a
- (+.) :: (Functor f, Num a) => a -> f a -> f a
- (.+.) :: (Applicative m, Num a) => m a -> m a -> m a
- (.*) :: (Functor f, Num a) => f a -> a -> f a
- (*.) :: (Functor f, Num a) => a -> f a -> f a
- (.*.) :: (Applicative m, Num a) => m a -> m a -> m a
- (.-) :: (Functor f, Num a) => f a -> a -> f a
- (-.) :: (Functor f, Num a) => a -> f a -> f a
- (.-.) :: (Applicative m, Num a) => m a -> m a -> m a
- (./) :: (Functor f, Fractional a) => f a -> a -> f a
- (/.) :: (Functor f, Fractional a) => a -> f a -> f a
- (./.) :: (Applicative m, Fractional a) => m a -> m a -> m a
- composeM :: Monad m => [a -> m a] -> a -> m a
- chainM :: Monad m => Int -> (b -> m b) -> b -> m b

# Documentation

(.+.) :: (Applicative m, Num a) => m a -> m a -> m a infixl 6 Source

`+`

variant with `Applicative`

at left and right.

fmap (== 5) (return 3 .+. return 2) [3,4] .+. [2,3] == [5,6,6,7] getZipList (ZipList [3,4] .+. ZipList [2,3]) == [5,7]

(.*.) :: (Applicative m, Num a) => m a -> m a -> m a infixl 7 Source

`*`

variant with `Applicative`

at left and right.

fmap (== 6) (return 3 .*. return 2)

(.-.) :: (Applicative m, Num a) => m a -> m a -> m a infixl 6 Source

`-`

variant with `Applicative`

at left and right.

fmap (== 1) (return 3 .-. return 2) [3,4] .-. [2,3] == [1,0,2,1] getZipList (ZipList [3,4] .-. ZipList [2,3]) == [1,1]

(./) :: (Functor f, Fractional a) => f a -> a -> f a infixl 7 Source

(/.) :: (Functor f, Fractional a) => a -> f a -> f a infixl 7 Source

(./.) :: (Applicative m, Fractional a) => m a -> m a -> m a infixl 7 Source

`/`

variant with `Applicative`

at left and right.

fmap (== 3) (return 6 ./. return 2) [5,6] ./. [2,3] == [5/2,5/3,3,2]