mezzo-0.3.1.0: Typesafe music composition

Copyright(c) Dima Szamozvancev
LicenseMIT
Maintainerds709@cam.ac.uk
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Mezzo.Compose.Builder

Contents

Description

Pattern of combinatorially building musical terms of various types.

Synopsis

General builder types

type Spec t = forall m. (t -> m) -> m Source #

Specifier: specifies a value of some type which starts the building.

type Conv s t = s -> Spec t Source #

Converter: converts a value of type s to a value of type t.

type Mut t = Conv t t Source #

Mutator: mutates a value of type t.

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).

spec :: t -> Spec t Source #

Returns a new specifier for the given value.

constConv :: t -> Conv s t Source #

A converter that ignores its argument and returns the given constant value.

Music-specific builder types

type RootS r = Primitive r => Spec (Root r) Source #

Root specifier.

type RestS = Spec (Pit Silence) Source #

Rest specifier.

type ChorS c = Primitive c => Spec (Cho c) Source #

Chord specifier.

type RootM r r' = (Primitive r, Primitive r') => Mut' (Root r) (Root r') Source #

Root mutator.

type ChorM c c' = (Primitive c, Primitive c') => Mut' (Cho c) (Cho c') Source #

Chord mutator.

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.

type ChorC' c r t i = (Primitive r, Primitive t, Primitive i) => AConv (Inv i) (Root r) (Cho (c r t i)) Source #

Converter from roots to chords.

type RootT s r d = Primitive r => Term (Root r) (Music s (FromRoot r d)) Source #

Note terminator.

type RestT s d = Term (Pit Silence) (Music s (FromSilence d)) Source #

type ChorT s c d = Primitive c => Term (Cho c) (Music s (FromChord c d)) Source #

Chord terminator.