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

Safe HaskellNone
LanguageHaskell2010

Data.Functor.Couple

Description

Defines two variants of (,) with lifted instances for the standard type classes.

The Functor, Applicative and Comonad instances are the standard instances. The Monad instances are not in base (but should argubly be there). All of these instances are equivalent to Writer in transformers.

Applicative is used to lift Monoid and the standard numeric classes.

The only difference between Twain and Couple is the handling of Eq and Ord: Twain compares only the second value, while Couple compares both. Thus Couple needs an extra Ord b constraint for all sub-classes of Ord.

Synopsis

Documentation

newtype Twain b a Source

A variant of pair/writer with lifted instances for the numeric classes, using Applicative.

Constructors

Twain 

Fields

getTwain :: (b, a)
 

Instances

Monoid b => Monad (Twain b) 
Functor (Twain b) 
Monoid b => Applicative (Twain b) 
Foldable (Twain b) 
Traversable (Twain b) 
Comonad (Twain b) 
(Monoid b, Bounded a) => Bounded (Twain b a) 
(Monoid b, Enum a) => Enum (Twain b a) 
Eq a => Eq (Twain b a) 
(Monoid b, Floating a) => Floating (Twain b a) 
(Monoid b, Fractional a) => Fractional (Twain b a) 
(Monoid b, Real a, Enum a, Integral a) => Integral (Twain b a) 
(Monoid b, Num a) => Num (Twain b a) 
Ord a => Ord (Twain b a) 
(Monoid b, Real a) => Real (Twain b a) 
(Monoid b, RealFrac a) => RealFrac (Twain b a) 
(Show b, Show a) => Show (Twain b a) 
(Monoid b, Monoid a) => Monoid (Twain b a) 
(Semigroup b, Semigroup a) => Semigroup (Twain b a) 
Wrapped (Twain b a) 
HasMeta a => HasMeta (Twain b a) 
Typeable (* -> * -> *) Twain 
Rewrapped (Twain c a) (Twain c b) 
type Unwrapped (Twain b a) = (b, a) 

newtype Couple b a Source

A variant of pair/writer with lifted instances for the numeric classes, using Applicative.

Constructors

Couple 

Fields

getCouple :: (b, a)
 

Instances

Monoid b => Monad (Couple b) 
Functor (Couple b) 
Monoid b => Applicative (Couple b) 
Foldable (Couple b) 
Traversable (Couple b) 
Comonad (Couple b) 
Eq a => Eq1 (Couple a) 
Ord a => Ord1 (Couple a) 
(Monoid b, Bounded a) => Bounded (Couple b a) 
(Monoid b, Enum a) => Enum (Couple b a) 
(Eq b, Eq a) => Eq (Couple b a) 
(Monoid b, Floating a) => Floating (Couple b a) 
(Monoid b, Fractional a) => Fractional (Couple b a) 
(Monoid b, Ord b, Real a, Enum a, Integral a) => Integral (Couple b a) 
(Monoid b, Num a) => Num (Couple b a) 
(Ord b, Ord a) => Ord (Couple b a) 
(Monoid b, Ord b, Real a) => Real (Couple b a) 
(Monoid b, Ord b, RealFrac a) => RealFrac (Couple b a) 
(Show b, Show a) => Show (Couple b a) 
(Monoid b, Monoid a) => Monoid (Couple b a) 
(Semigroup b, Semigroup a) => Semigroup (Couple b a) 
Wrapped (Couple b a) 
(Monoid b, IsDynamics a) => IsDynamics (Couple b a) 
(Monoid b, IsPitch a) => IsPitch (Couple b a) 
(Monoid b, Augmentable a) => Augmentable (Couple b a) 
(Monoid b, Alterable a) => Alterable (Couple b a) 
(Monoid b, Transformable a) => Transformable (Couple b a) 
(Monoid b, Reversible a) => Reversible (Couple b a) 
Tiable a => Tiable (Couple b a) 
HasSlide a => HasSlide (Couple b a) 
HasText a => HasText (Couple b a) 
HasHarmonic a => HasHarmonic (Couple b a) 
HasTremolo a => HasTremolo (Couple b a) 
Typeable (* -> * -> *) Couple 
Rewrapped (Couple c a) (Couple c b) 
HasPitches a b => HasPitches (Couple c a) (Couple c b) 
HasPitch a b => HasPitch (Couple c a) (Couple c b) 
HasDynamics a b => HasDynamics (Couple c a) (Couple c b) 
HasDynamic a b => HasDynamic (Couple c a) (Couple c b) 
HasArticulations a b => HasArticulations (Couple c a) (Couple c b) 
HasArticulation a b => HasArticulation (Couple c a) (Couple c b) 
type SetPitch g (Couple c a) = Couple c (SetPitch g a) 
type SetDynamic g (Couple c a) = Couple c (SetDynamic g a) 
type SetArticulation g (Couple c a) = Couple c (SetArticulation g a) 
type Unwrapped (Couple b a) = (b, a) 
type Pitch (Couple c a) = Pitch a 
type Dynamic (Couple c a) = Dynamic a 
type Articulation (Couple c a) = Articulation a