tuples-homogenous-h98-0.1.1.0: Wrappers for n-ary tuples with Traversable and Applicative/Monad instances.

Safe HaskellSafe-Inferred

Data.Tuple.Homogenous

Description

Provides wrappers for homogenous tuples defined as

 newtype TupleN a = TupleN (a,...,a)

together with helper methods

 tupleN :: a -> ... -> a -> TupleN a

and instances for

  • Functor applies a given function to all elements of a tuple.
  • Applicative zips two tuples, applying i-th function of the first to i-th element of the second.
  • Monad where i-th element of x >>= f is the result of applying f to the i-th element of x and taking its i-th result. In other words, join :: Tupple N (TuppleN a) -> TuppleN a returns the diagonal of the NxN matrix.
  • Foldable and Traversable folds/traverses over the N elements.

Synopsis

Documentation

newtype Tuple1 a Source

This newtype intentionally omits the untuple1 accessor as there is no 1-tuple in Haskell.

Constructors

Tuple1 a 

newtype Tuple2 a Source

Constructors

Tuple2 

Fields

untuple2 :: (a, a)
 

tuple2 :: a -> a -> Tuple2 aSource

newtype Tuple3 a Source

Constructors

Tuple3 

Fields

untuple3 :: (a, a, a)
 

tuple3 :: a -> a -> a -> Tuple3 aSource

newtype Tuple4 a Source

Constructors

Tuple4 

Fields

untuple4 :: (a, a, a, a)
 

tuple4 :: a -> a -> a -> a -> Tuple4 aSource

newtype Tuple5 a Source

Constructors

Tuple5 

Fields

untuple5 :: (a, a, a, a, a)
 

tuple5 :: a -> a -> a -> a -> a -> Tuple5 aSource

newtype Tuple6 a Source

Constructors

Tuple6 

Fields

untuple6 :: (a, a, a, a, a, a)
 

tuple6 :: a -> a -> a -> a -> a -> a -> Tuple6 aSource

newtype Tuple7 a Source

Constructors

Tuple7 

Fields

untuple7 :: (a, a, a, a, a, a, a)
 

tuple7 :: a -> a -> a -> a -> a -> a -> a -> Tuple7 aSource

newtype Tuple8 a Source

Constructors

Tuple8 

Fields

untuple8 :: (a, a, a, a, a, a, a, a)
 

tuple8 :: a -> a -> a -> a -> a -> a -> a -> a -> Tuple8 aSource

newtype Tuple9 a Source

Constructors

Tuple9 

Fields

untuple9 :: (a, a, a, a, a, a, a, a, a)
 

tuple9 :: a -> a -> a -> a -> a -> a -> a -> a -> a -> Tuple9 aSource

newtype Tuple10 a Source

Constructors

Tuple10 

Fields

untuple10 :: (a, a, a, a, a, a, a, a, a, a)
 

tuple10 :: a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> Tuple10 aSource

newtype Tuple11 a Source

Constructors

Tuple11 

Fields

untuple11 :: (a, a, a, a, a, a, a, a, a, a, a)
 

tuple11 :: a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> Tuple11 aSource

newtype Tuple12 a Source

Constructors

Tuple12 

Fields

untuple12 :: (a, a, a, a, a, a, a, a, a, a, a, a)
 

tuple12 :: a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> Tuple12 aSource

newtype Tuple13 a Source

Constructors

Tuple13 

Fields

untuple13 :: (a, a, a, a, a, a, a, a, a, a, a, a, a)
 

tuple13 :: a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> Tuple13 aSource

newtype Tuple14 a Source

Constructors

Tuple14 

Fields

untuple14 :: (a, a, a, a, a, a, a, a, a, a, a, a, a, a)
 

tuple14 :: a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> Tuple14 aSource

newtype Tuple15 a Source

Constructors

Tuple15 

Fields

untuple15 :: (a, a, a, a, a, a, a, a, a, a, a, a, a, a, a)
 

tuple15 :: a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> Tuple15 aSource