hmt-0.15: Haskell Music Theory

Safe Haskell | Safe
Language | Haskell98

Music.Theory.Tuple

Contents

- P2 (2 product)
- T2 (2-tuple, regular)
- P3 (3 product)
- T3 (3 triple, regular)
- P4 (4 product)
- T4 (4-tuple, regular)
- P5 (5 product)
- T5 (5-tuple, regular)
- P6 (6 product)
- T6 (6-tuple, regular)
- T7 (7-tuple, regular)
- T8 (8-tuple, regular)
- T9 (9-tuple, regular)

Description

Tuple functions.

Uniform tuples have types `T2`, `T3` etc. and functions names are prefixed `t2_` etc.

Heterogenous tuples (products) are prefixed `p2_` etc.

Synopsis

- p2_swap :: (s, t) -> (t, s)
- type T2 a = (a, a)
- t2 :: [t] -> T2 t
- t2_list :: T2 a -> [a]
- t2_swap :: T2 t -> T2 t
- t2_map :: (p -> q) -> T2 p -> T2 q
- t2_zipWith :: (p -> q -> r) -> T2 p -> T2 q -> T2 r
- t2_infix :: (a -> a -> b) -> T2 a -> b
- t2_join :: Monoid m => T2 m -> m
- t2_concat :: [T2 [a]] -> T2 [a]
- t2_sort :: Ord t => (t, t) -> (t, t)
- p3_rotate_left :: (s, t, u) -> (t, u, s)
- p3_fst :: (a, b, c) -> a
- p3_snd :: (a, b, c) -> b
- p3_third :: (a, b, c) -> c
- type T3 a = (a, a, a)
- t3 :: [t] -> T3 t
- t3_rotate_left :: T3 t -> T3 t
- t3_fst :: T3 t -> t
- t3_snd :: T3 t -> t
- t3_third :: T3 t -> t
- t3_map :: (p -> q) -> T3 p -> T3 q
- t3_zipWith :: (p -> q -> r) -> T3 p -> T3 q -> T3 r
- t3_list :: T3 a -> [a]
- t3_infix :: (a -> a -> a) -> T3 a -> a
- t3_join :: T3 [a] -> [a]
- p4_fst :: (a, b, c, d) -> a
- p4_snd :: (a, b, c, d) -> b
- p4_third :: (a, b, c, d) -> c
- p4_fourth :: (a, b, c, d) -> d
- type T4 a = (a, a, a, a)
- t4 :: [t] -> T4 t
- t4_list :: T4 t -> [t]
- t4_fst :: T4 t -> t
- t4_snd :: T4 t -> t
- t4_third :: T4 t -> t
- t4_fourth :: T4 t -> t
- t4_map :: (p -> q) -> T4 p -> T4 q
- t4_zipWith :: (p -> q -> r) -> T4 p -> T4 q -> T4 r
- t4_infix :: (a -> a -> a) -> T4 a -> a
- t4_join :: T4 [a] -> [a]
- p5_fst :: (a, b, c, d, e) -> a
- p5_snd :: (a, b, c, d, e) -> b
- p5_third :: (a, b, c, d, e) -> c
- p5_fourth :: (a, b, c, d, e) -> d
- p5_fifth :: (a, b, c, d, e) -> e
- type T5 a = (a, a, a, a, a)
- t5 :: [t] -> T5 t
- t5_list :: T5 t -> [t]
- t5_map :: (p -> q) -> T5 p -> T5 q
- t5_fst :: T5 t -> t
- t5_snd :: T5 t -> t
- t5_fourth :: T5 t -> t
- t5_fifth :: T5 t -> t
- t5_infix :: (a -> a -> a) -> T5 a -> a
- t5_join :: T5 [a] -> [a]
- p6_fst :: (a, b, c, d, e, f) -> a
- p6_snd :: (a, b, c, d, e, f) -> b
- p6_third :: (a, b, c, d, e, f) -> c
- p6_fourth :: (a, b, c, d, e, f) -> d
- p6_fifth :: (a, b, c, d, e, f) -> e
- p6_sixth :: (a, b, c, d, e, f) -> f
- type T6 a = (a, a, a, a, a, a)
- t6 :: [t] -> T6 t
- t6_list :: T6 t -> [t]
- t6_map :: (p -> q) -> T6 p -> T6 q
- type T7 a = (a, a, a, a, a, a, a)
- t7_list :: T7 t -> [t]
- t7_map :: (p -> q) -> T7 p -> T7 q
- type T8 a = (a, a, a, a, a, a, a, a)
- t8_list :: T8 t -> [t]
- t8_map :: (p -> q) -> T8 p -> T8 q
- type T9 a = (a, a, a, a, a, a, a, a, a)
- t9_list :: T9 t -> [t]
- t9_map :: (p -> q) -> T9 p -> T9 q

# P2 (2 product)

p2_swap :: (s, t) -> (t, s) Source #

# T2 (2-tuple, regular)

type T2 a = (a, a) Source #

Uniform two-tuple.

t2 :: [t] -> T2 t Source #

t2_list :: T2 a -> [a] Source #

t2_swap :: T2 t -> T2 t Source #

t2_map :: (p -> q) -> T2 p -> T2 q Source #

t2_zipWith :: (p -> q -> r) -> T2 p -> T2 q -> T2 r Source #

t2_infix :: (a -> a -> b) -> T2 a -> b Source #

t2_join :: Monoid m => T2 m -> m Source #

Infix `mappend`.

    t2_join ([1,2],[3,4]) == [1,2,3,4]

t2_concat :: [T2 [a]] -> T2 [a] Source #

t2_sort :: Ord t => (t, t) -> (t, t) Source #

# P3 (3 product)

p3_rotate_left :: (s, t, u) -> (t, u, s) Source #

Left rotation.

    p3_rotate_left (1,2,3) == (2,3,1)

p3_fst :: (a, b, c) -> a Source #

p3_snd :: (a, b, c) -> b Source #

p3_third :: (a, b, c) -> c Source #

# T3 (3 triple, regular)

type T3 a = (a, a, a) Source #

t3 :: [t] -> T3 t Source #

t3_rotate_left :: T3 t -> T3 t Source #

t3_fst :: T3 t -> t Source #

t3_snd :: T3 t -> t Source #

t3_third :: T3 t -> t Source #

t3_map :: (p -> q) -> T3 p -> T3 q Source #

t3_zipWith :: (p -> q -> r) -> T3 p -> T3 q -> T3 r Source #

t3_list :: T3 a -> [a] Source #

t3_infix :: (a -> a -> a) -> T3 a -> a Source #

t3_join :: T3 [a] -> [a] Source #

# P4 (4 product)

p4_fst :: (a, b, c, d) -> a Source #

p4_snd :: (a, b, c, d) -> b Source #

p4_third :: (a, b, c, d) -> c Source #

p4_fourth :: (a, b, c, d) -> d Source #

# T4 (4-tuple, regular)

type T4 a = (a, a, a, a) Source #

t4 :: [t] -> T4 t Source #

t4_list :: T4 t -> [t] Source #

t4_fst :: T4 t -> t Source #

t4_snd :: T4 t -> t Source #

t4_third :: T4 t -> t Source #

t4_fourth :: T4 t -> t Source #

t4_map :: (p -> q) -> T4 p -> T4 q Source #

t4_zipWith :: (p -> q -> r) -> T4 p -> T4 q -> T4 r Source #

t4_infix :: (a -> a -> a) -> T4 a -> a Source #

t4_join :: T4 [a] -> [a] Source #

# P5 (5 product)

p5_fst :: (a, b, c, d, e) -> a Source #

p5_snd :: (a, b, c, d, e) -> b Source #

p5_third :: (a, b, c, d, e) -> c Source #

p5_fourth :: (a, b, c, d, e) -> d Source #

p5_fifth :: (a, b, c, d, e) -> e Source #

# T5 (5-tuple, regular)

type T5 a = (a, a, a, a, a) Source #

t5 :: [t] -> T5 t Source #

t5_list :: T5 t -> [t] Source #

t5_map :: (p -> q) -> T5 p -> T5 q Source #

t5_fst :: T5 t -> t Source #

t5_snd :: T5 t -> t Source #

t5_fourth :: T5 t -> t Source #

t5_fifth :: T5 t -> t Source #

t5_infix :: (a -> a -> a) -> T5 a -> a Source #

t5_join :: T5 [a] -> [a] Source #

# P6 (6 product)

p6_fst :: (a, b, c, d, e, f) -> a Source #

p6_snd :: (a, b, c, d, e, f) -> b Source #

p6_third :: (a, b, c, d, e, f) -> c Source #

p6_fourth :: (a, b, c, d, e, f) -> d Source #

p6_fifth :: (a, b, c, d, e, f) -> e Source #

p6_sixth :: (a, b, c, d, e, f) -> f Source #

# T6 (6-tuple, regular)

type T6 a = (a, a, a, a, a, a) Source #

t6 :: [t] -> T6 t Source #

t6_list :: T6 t -> [t] Source #

t6_map :: (p -> q) -> T6 p -> T6 q Source #

# T7 (7-tuple, regular)

type T7 a = (a, a, a, a, a, a, a) Source #

t7_list :: T7 t -> [t] Source #

t7_map :: (p -> q) -> T7 p -> T7 q Source #

# T8 (8-tuple, regular)

type T8 a = (a, a, a, a, a, a, a, a) Source #

t8_list :: T8 t -> [t] Source #

t8_map :: (p -> q) -> T8 p -> T8 q Source #

# T9 (9-tuple, regular)

type T9 a = (a, a, a, a, a, a, a, a, a) Source #

t9_list :: T9 t -> [t] Source #

t9_map :: (p -> q) -> T9 p -> T9 q Source #