haskore-0.2.0.3: The Haskore Computer Music System

Safe Haskell | None

Medium.LabeledControlled.List

Synopsis

- data T label control content = Cons {
  - label :: label
  - structure :: Structure label control content
  }
- data Structure label control content
  - = Primitive content
  - | Serial [T label control content]
  - | Parallel [T label control content]
  - | Control control (T label control content)
- class Label label where
  - emptyLabel :: label
  - foldLabelSerial :: [label] -> label
  - foldLabelParallel :: [label] -> label
- serialLabel :: Label label => [T label control content] -> T label control content
- parallelLabel :: Label label => [T label control content] -> T label control content
- switchList :: (label -> b -> c) -> (a -> b) -> ([T label control a] -> b) -> ([T label control a] -> b) -> (control -> T label control a -> b) -> T label control a -> c
- foldList :: (label -> b -> c) -> (a -> b) -> ([c] -> b) -> ([c] -> b) -> (control -> c -> b) -> T label control a -> c
- fromControlledMediumList :: Label label => (a -> (label, b)) -> (control -> T label control b -> label) -> T control a -> T label control b
- mapLabel :: (i -> j) -> T i control a -> T j control a
- serialToList :: T label control a -> [T label control a]
- parallelToList :: T label control a -> [T label control a]

# Documentation

data T label control content Source

Medium type with a label (e.g. the duration of the represented music), a controller constructor and direct support for rests.

Constructors

Cons |

Fields

label :: label
structure :: Structure label control content

Instances

Functor (T i control) |
Foldable (T i control) |
Traversable (T i control) |
Label label => Construct (T label control) |
(Eq label, Eq control, Eq content) => Eq (T label control content) |
(Ord label, Ord control, Ord content) => Ord (T label control content) |
(Show label, Show control, Show content) => Show (T label control content) |

data Structure label control content Source

Constructors

Primitive content | primitive content
Serial [T label control content] | sequential composition
Parallel [T label control content] | parallel composition
Control control (T label control content) | controller

Instances

(Eq label, Eq control, Eq content) => Eq (Structure label control content) |
(Ord label, Ord control, Ord content) => Ord (Structure label control content) |
(Show label, Show control, Show content) => Show (Structure label control content) |

class Label label where Source

Methods

emptyLabel :: labelSource

foldLabelSerial :: [label] -> labelSource

foldLabelParallel :: [label] -> labelSource

serialLabel :: Label label => [T label control content] -> T label control contentSource

parallelLabel :: Label label => [T label control content] -> T label control contentSource

switchList :: (label -> b -> c) -> (a -> b) -> ([T label control a] -> b) -> ([T label control a] -> b) -> (control -> T label control a -> b) -> T label control a -> cSource

foldList :: (label -> b -> c) -> (a -> b) -> ([c] -> b) -> ([c] -> b) -> (control -> c -> b) -> T label control a -> cSource

fromControlledMediumList :: Label label => (a -> (label, b)) -> (control -> T label control b -> label) -> T control a -> T label control bSource

mapLabel :: (i -> j) -> T i control a -> T j control aSource

serialToList :: T label control a -> [T label control a]Source

parallelToList :: T label control a -> [T label control a]Source