Safe Haskell | Safe-Inferred |
---|
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 ofx >>= f
is the result of applyingf
to the i-th element ofx
and taking its i-th result. In other words,join :: Tupple N (TuppleN a) -> TuppleN a
returns the diagonal of the NxN matrix. -
Foldable
andTraversable
folds/traverses over the N elements.
- newtype Tuple0 a = Tuple0 {
- untuple0 :: ()
- tuple0 :: Tuple0 a
- newtype Tuple1 a = Tuple1 a
- tuple1 :: a -> Tuple1 a
- newtype Tuple2 a = Tuple2 {
- untuple2 :: (a, a)
- tuple2 :: a -> a -> Tuple2 a
- newtype Tuple3 a = Tuple3 {
- untuple3 :: (a, a, a)
- tuple3 :: a -> a -> a -> Tuple3 a
- newtype Tuple4 a = Tuple4 {
- untuple4 :: (a, a, a, a)
- tuple4 :: a -> a -> a -> a -> Tuple4 a
- newtype Tuple5 a = Tuple5 {
- untuple5 :: (a, a, a, a, a)
- tuple5 :: a -> a -> a -> a -> a -> Tuple5 a
- newtype Tuple6 a = Tuple6 {
- untuple6 :: (a, a, a, a, a, a)
- tuple6 :: a -> a -> a -> a -> a -> a -> Tuple6 a
- newtype Tuple7 a = Tuple7 {
- untuple7 :: (a, a, a, a, a, a, a)
- tuple7 :: a -> a -> a -> a -> a -> a -> a -> Tuple7 a
- newtype Tuple8 a = Tuple8 {
- untuple8 :: (a, a, a, a, a, a, a, a)
- tuple8 :: a -> a -> a -> a -> a -> a -> a -> a -> Tuple8 a
- newtype Tuple9 a = Tuple9 {
- untuple9 :: (a, a, a, a, a, a, a, a, a)
- tuple9 :: a -> a -> a -> a -> a -> a -> a -> a -> a -> Tuple9 a
- newtype Tuple10 a = Tuple10 {
- untuple10 :: (a, a, a, a, a, a, a, a, a, a)
- tuple10 :: a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> Tuple10 a
- newtype Tuple11 a = Tuple11 {
- 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 a
- newtype Tuple12 a = Tuple12 {
- 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 a
- newtype Tuple13 a = Tuple13 {
- 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 a
- newtype Tuple14 a = Tuple14 {
- 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 a
- newtype Tuple15 a = Tuple15 {
- 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 a
Documentation
This newtype
intentionally omits the untuple1
accessor as there is no
1-tuple in Haskell.
Tuple1 a |