hmt-0.15: Haskell Music Theory

Safe Haskell | Safe
Language | Haskell98

Music.Theory.Function

Contents

- Predicate composition.
- Function composition.

Description

Data.Function related functions.

Synopsis

- predicate_and :: (t -> Bool) -> (t -> Bool) -> t -> Bool
- predicate_all :: [t -> Bool] -> t -> Bool
- predicate_or :: (t -> Bool) -> (t -> Bool) -> t -> Bool
- predicate_any :: [t -> Bool] -> t -> Bool
- (.:) :: (Functor f, Functor g) => (a -> b) -> f (g a) -> f (g b)
- (.::) :: (Functor f, Functor g, Functor h) => (a -> b) -> f (g (h a)) -> f (g (h b))
- (.:::) :: (Functor f, Functor g, Functor h, Functor i) => (a -> b) -> f (g (h (i a))) -> f (g (h (i b)))
- (.::::) :: (Functor f, Functor g, Functor h, Functor i, Functor j) => (a -> b) -> f (g (h (i (j a)))) -> f (g (h (i (j b))))
- (.:::::) :: (Functor f, Functor g, Functor h, Functor i, Functor j, Functor k) => (a -> b) -> f (g (h (i (j (k a))))) -> f (g (h (i (j (k b)))))

# Predicate composition.

predicate_and :: (t -> Bool) -> (t -> Bool) -> t -> Bool Source #

`&&` of predicates.

predicate_all :: [t -> Bool] -> t -> Bool Source #

`all` of predicates.

    let r = [False,False,True,False,True,False]
    in map (predicate_all [(> 0),(< 5),even]) [0..5] == r

predicate_or :: (t -> Bool) -> (t -> Bool) -> t -> Bool Source #

`||` of predicates.

predicate_any :: [t -> Bool] -> t -> Bool Source #

`any` of predicates.

    let r = [True,False,True,False,True,True]
    in map (predicate_any [(== 0),(== 5),even]) [0..5] == r

# Function composition.

(.:) :: (Functor f, Functor g) => (a -> b) -> f (g a) -> f (g b) infixr 8 Source #

`fmap` `.` `fmap`, ie. `(t -> c) -> (a -> b -> t) -> a -> b -> c`.

(.::) :: (Functor f, Functor g, Functor h) => (a -> b) -> f (g (h a)) -> f (g (h b)) infixr 8 Source #

`fmap` `.` `.:`, ie. `(t -> d) -> (a -> b -> c -> t) -> a -> b -> c -> d`.

(.:::) :: (Functor f, Functor g, Functor h, Functor i) => (a -> b) -> f (g (h (i a))) -> f (g (h (i b))) infixr 8 Source #

`fmap` `.` `.::`.

(.::::) :: (Functor f, Functor g, Functor h, Functor i, Functor j) => (a -> b) -> f (g (h (i (j a)))) -> f (g (h (i (j b)))) infixr 8 Source #

`fmap` `.` `.:::`.

(.:::::) :: (Functor f, Functor g, Functor h, Functor i, Functor j, Functor k) => (a -> b) -> f (g (h (i (j (k a))))) -> f (g (h (i (j (k b))))) infixr 8 Source #

`fmap` `.` `.::::`.