Copyright | (c) Dima Szamozvancev |
---|---|
License | MIT |
Maintainer | ds709@cam.ac.uk |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell2010 |
Pattern of combinatorially building musical terms of various types.
- type Spec t = forall m. (t -> m) -> m
- type Conv s t = s -> Spec t
- type Mut t = Conv t t
- type Term t r = t -> r
- type AConv a s t = s -> a -> Spec t
- type AMut a t = AConv a t t
- type ATerm a t r = t -> a -> r
- type Mut' t t' = Conv t t'
- spec :: t -> Spec t
- constConv :: t -> Conv s t
- type RootS r = Primitive r => Spec (Root r)
- type RestS = Spec (Pit Silence)
- type ChorS c = Primitive c => Spec (Cho c)
- type RootM r r' = (Primitive r, Primitive r') => Mut' (Root r) (Root r')
- type ChorM c c' = (Primitive c, Primitive c') => Mut' (Cho c) (Cho c')
- type ChorC c r t = (Primitive r, Primitive t) => Conv (Root r) (Cho (c r t Inv0))
- type ChorC' c r t i = (Primitive r, Primitive t, Primitive i) => AConv (Inv i) (Root r) (Cho (c r t i))
- type RootT s r d = Primitive r => Term (Root r) (Music s (FromRoot r d))
- type RestT s d = Term (Pit Silence) (Music s (FromSilence d))
- type ChorT s c d = Primitive c => Term (Cho c) (Music s (FromChord c d))
General builder types
type Spec t = forall m. (t -> m) -> m Source #
Specifier: specifies a value of some type which starts the building.
type Term t r = t -> r Source #
Terminator: finishes building a value of type t and returns a result of type r.
type AConv a s t = s -> a -> Spec t Source #
Converter with argument: converts a value of type s to a value of type t, consuming an argument of type a.
type AMut a t = AConv a t t Source #
Mutator with argument: mutates a value of type t, consuming an argument of type a.
type ATerm a t r = t -> a -> r Source #
Terminator with argument: finishes building a value of type t, returning a result of type r, consuming an argument of type a.
type Mut' t t' = Conv t t' Source #
Flexible mutator: mutator that allows slight changes in the type (otherwise use Conv
).
constConv :: t -> Conv s t Source #
A converter that ignores its argument and returns the given constant value.
Music-specific builder types
type ChorC c r t = (Primitive r, Primitive t) => Conv (Root r) (Cho (c r t Inv0)) Source #
Converter from roots to chords, using the default inversion.