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

Portabilitynon-portable (TF,GNTD)
Stabilityexperimental
Maintainerhans@hanshoglund.se
Safe HaskellNone

Music.Time.Reverse

Contents

Description

Provides reversible values.

Synopsis

Reversible class

class Reversible a whereSource

Reversible values.

For instances of Reversible and HasOnset, the following laws should hold:

 onset a    = onset (rev a)
 duration a = duration (rev a)

For structural types, rev is applied recursively, hence the constraint on the Score instance. rev is id by default, so for a trivial type T it suffices to write

 instance Reversible T

For instances U of HasOnset and Transformable, a suitable instance is

 instance Reversible T where
     rev = withSameOnset (stretch (-1))

Methods

rev :: a -> aSource

Reverse a value.

Reverse is an involution, meaning that:

 rev (rev a) = a

Utility

newtype NoRev a Source

Constructors

NoRev 

Fields

getNoRev :: a
 

Instances

Enum a => Enum (NoRev a) 
Eq a => Eq (NoRev a) 
Ord a => Ord (NoRev a) 
Show a => Show (NoRev a) 
Monoid a => Monoid (NoRev a) 
Semigroup a => Semigroup (NoRev a) 
Delayable a => Delayable (NoRev a) 
Stretchable a => Stretchable (NoRev a) 
HasOffset a => HasOffset (NoRev a) 
HasOnset a => HasOnset (NoRev a) 
HasDuration a => HasDuration (NoRev a) 
Reversible (NoRev a) 

newtype WithRev a Source

Constructors

WithRev (a, a) 

Instances

Eq a => Eq (WithRev a) 
Ord a => Ord (WithRev a) 
Monoid a => Monoid (WithRev a) 
Semigroup a => Semigroup (WithRev a) 
Reversible a => Reversible (WithRev a)