-- | Abbreviated names for 'Duration' values when written as Haskell literals.
-- There are /letter/ names where 'w' is 'whole_note' and so on, and
-- /numerical/ names where '_4' is 'quarter_note' and so on.  In both
-- cases a @'@ extension means a @dot@ so that 'e''' is a double
-- dotted 'eighth_note'.  The prefix is @_@ not @d@ since @d4@ etc. are
-- also note names.
--
-- > zipWith duration_compare_meq [e,e,e,e'] [e,s,q,e] == [EQ,GT,LT,GT]
-- > zipWith sum_dur [e,q,q'] [e,e,e] == [Just q,Just q',Just h]
-- > zipWith sum_dur' [e,q,q'] [e,e,e] == [q,q',h]
module Music.Theory.Duration.Name.Abbreviation where

import Music.Theory.Duration
import Music.Theory.Duration.Name

-- * Letter names

w,h,q,e,s :: Duration
w :: Duration
w = Duration
whole_note
h :: Duration
h = Duration
half_note
q :: Duration
q = Duration
quarter_note
e :: Duration
e = Duration
eighth_note
s :: Duration
s = Duration
sixteenth_note

w',h',q',e',s' :: Duration
w' :: Duration
w' = Duration
dotted_whole_note
h' :: Duration
h' = Duration
dotted_half_note
q' :: Duration
q' = Duration
dotted_quarter_note
e' :: Duration
e' = Duration
dotted_eighth_note
s' :: Duration
s' = Duration
dotted_sixteenth_note

w'',h'',q'',e'',s'' :: Duration
w'' :: Duration
w'' = Integer -> Int -> Rational -> Duration
Duration Integer
1 Int
2 Rational
1
h'' :: Duration
h'' = Integer -> Int -> Rational -> Duration
Duration Integer
2 Int
2 Rational
1
q'' :: Duration
q'' = Integer -> Int -> Rational -> Duration
Duration Integer
4 Int
2 Rational
1
e'' :: Duration
e'' = Integer -> Int -> Rational -> Duration
Duration Integer
8 Int
2 Rational
1
s'' :: Duration
s'' = Integer -> Int -> Rational -> Duration
Duration Integer
16 Int
2 Rational
1

-- * Numerical names

_1,_2,_4,_8,_16,_32 :: Duration
_1 :: Duration
_1 = Duration
whole_note
_2 :: Duration
_2 = Duration
half_note
_4 :: Duration
_4 = Duration
quarter_note
_8 :: Duration
_8 = Duration
eighth_note
_16 :: Duration
_16 = Duration
sixteenth_note
_32 :: Duration
_32 = Integer -> Int -> Rational -> Duration
Duration Integer
32 Int
0 Rational
1

_1',_2',_4',_8',_16',_32' :: Duration
_1' :: Duration
_1' = Duration
dotted_whole_note
_2' :: Duration
_2' = Duration
dotted_half_note
_4' :: Duration
_4' = Duration
dotted_quarter_note
_8' :: Duration
_8' = Duration
dotted_eighth_note
_16' :: Duration
_16' = Duration
dotted_sixteenth_note
_32' :: Duration
_32' = Integer -> Int -> Rational -> Duration
Duration Integer
32 Int
1 Rational
1

_1'',_2'',_4'',_8'',_16'',_32'' :: Duration
_1'' :: Duration
_1'' = Integer -> Int -> Rational -> Duration
Duration Integer
1 Int
2 Rational
1
_2'' :: Duration
_2'' = Integer -> Int -> Rational -> Duration
Duration Integer
2 Int
2 Rational
1
_4'' :: Duration
_4'' = Integer -> Int -> Rational -> Duration
Duration Integer
4 Int
2 Rational
1
_8'' :: Duration
_8'' = Integer -> Int -> Rational -> Duration
Duration Integer
8 Int
2 Rational
1
_16'' :: Duration
_16'' = Integer -> Int -> Rational -> Duration
Duration Integer
16 Int
2 Rational
1
_32'' :: Duration
_32'' = Integer -> Int -> Rational -> Duration
Duration Integer
32 Int
2 Rational
1