| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
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.
Documentation
A variant of pair/writer with lifted instances for the numeric classes, using Applicative.
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) | |
| Wrapped (Twain b a) | |
| (Semigroup b, Semigroup a) => Semigroup (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) |
A variant of pair/writer with lifted instances for the numeric classes, using Applicative.
Instances