Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Rq
sub-divisions.
Synopsis
- type Rq_Div = (Rational, Integer, [Integer], Tied_Right)
- type Rq1_Div = (Integer, [Integer], Tied_Right)
- rq1_div_to_rq_div :: Rq1_Div -> Rq_Div
- rq_div_verify :: Rq_Div -> Bool
- rq_div_mm_verify :: Int -> [Rq_Div] -> [(Integer, [Rq])]
- rq_div_to_rq_set_t :: Rq_Div -> ([Rq], Tied_Right)
- rq_set_t_to_rqt :: ([Rq], Tied_Right) -> [Rq_Tied]
- rq_div_seq_rq :: [Rq_Div] -> [Rq]
- partitions_sum :: Integral i => i -> [[i]]
- partitions_sum_p :: Integral i => i -> [[i]]
- rq1_div_univ :: Integer -> [Rq1_Div]
Documentation
type Rq_Div = (Rational, Integer, [Integer], Tied_Right) Source #
Divisions of n Rq
into i equal parts grouped as j.
A quarter and eighth note triplet is written (1,1,[2,1],False)
.
rq_div_verify :: Rq_Div -> Bool Source #
Verify that grouping j sums to the divisor i.
rq_div_to_rq_set_t :: Rq_Div -> ([Rq], Tied_Right) Source #
rq_set_t_to_rqt :: ([Rq], Tied_Right) -> [Rq_Tied] Source #
Translate from result of rq_div_to_rq_set_t
to seqeunce of Rq_Tied
.
rq_set_t_to_rqt ([1/5,3/5,1/5],True) == [(1/5,_f),(3/5,_f),(1/5,_t)]
rq_div_seq_rq :: [Rq_Div] -> [Rq] Source #
partitions_sum :: Integral i => i -> [[i]] Source #
Partitions of an Integral
that sum to n. This includes the
two 'trivial paritions, into a set n 1
, and a set of 1
n.
partitions_sum 4 == [[1,1,1,1],[2,1,1],[2,2],[3,1],[4]]
map (length . partitions_sum) [9..15] == [30,42,56,77,101,135,176]
partitions_sum_p :: Integral i => i -> [[i]] Source #
The multiset_permutations
of partitions_sum
.
map (length . partitions_sum_p) [9..12] == [256,512,1024,2048]
rq1_div_univ :: Integer -> [Rq1_Div] Source #
The set of all Rq1_Div
that sum to n, a variant on
partitions_sum_p
.
map (length . rq1_div_univ) [3..5] == [8,16,32] map (length . rq1_div_univ) [9..12] == [512,1024,2048,4096]