tuple-generic-0.4.0.0: Generic operations on tuples

Safe HaskellSafe
LanguageHaskell2010

Data.Tuple.Generic

Description

This module supports operations with tuples with up to 16 elements.

Generic accessors and setters aren't included – if you want that, consider using microlens, which is a dependency-free alternative to lens providing generic lenses for tuples.

Synopsis

Documentation

cons :: TupleCons a b x => x -> a -> b Source

Prepend a value to a tuple.

>>> cons 0 (1,2,3)
(0,1,2,3)

snoc :: TupleSnoc a b x => a -> x -> b Source

Append a value to a tuple.

>>> snoc (1,2,3) 4
(1,2,3,4)