music-score-1.9.0: Musical score and part representation.

Copyright(c) Hans Hoglund 2012-2014
LicenseBSD-style
Maintainerhans@hanshoglund.se
Stabilityexperimental
Portabilitynon-portable (TF,GNTD)
Safe HaskellNone
LanguageHaskell2010

Music.Time.Split

Contents

Description

 

Synopsis

Documentation

The Splittable class

class HasDuration a => Splittable a where Source

Class of values that can be split.

Instances should satisfy:

(beginning t x)^.duration + (ending t x)^.duration = x^.duration
(beginning t x)^.duration = t min x^.duration                    iff t >= 0
(ending t x)^.duration    = x^.duration - (t min x^.duration)    iff t >= 0

(Note that any of these three laws can be derived from the other two, so it is sufficient to prove two!).

Minimal complete definition

split | beginning, ending

Methods

split :: Duration -> a -> (a, a) Source

 Split a value at the given duration and return both parts.

beginning :: Duration -> a -> a Source

 Split a value at the given duration and return only the first part.

ending :: Duration -> a -> a Source

 Split a value at the given duration and return only the second part.

Miscellaneous

chunks :: (Transformable a, Splittable a) => Duration -> a -> [a] Source