# fp-ts

← Back

Source

## pair

``````Applicative1<URI> & Foldable2v1<URI> & Traversable2v1<URI> & Comonad1<URI>
``````

# Pair

``````constructor(readonly fst: A, readonly snd: A) {}
``````

## ap

``````<B>(fab: Pair<(a: A) => B>): Pair<B>
``````

## ap_

``````<B, C>(this: Pair<(b: B) => C>, fb: Pair<B>): Pair<C>
``````

Flipped version of ap

## extend

``````<B>(f: (fb: Pair<A>) => B): Pair<B>
``````

## extract

``````(): A
``````

## first

``````(f: Endomorphism<A>): Pair<A>
``````

Map a function over the first field of a pair

## map

``````<B>(f: (a: A) => B): Pair<B>
``````

## reduce

``````<B>(b: B, f: (b: B, a: A) => B): B
``````

## second

``````(f: Endomorphism<A>): Pair<A>
``````

Map a function over the second field of a pair

## swap

``````(): Pair<A>
``````

Swaps the elements in a pair

## getMonoid

``````<A>(M: Monoid<A>): Monoid<Pair<A>>
``````

## getOrd

``````<A>(O: Ord<A>): Ord<Pair<A>>
``````

## getSemigroup

``````<A>(S: Semigroup<A>): Semigroup<Pair<A>>
``````

``````<A>(S: Setoid<A>): Setoid<Pair<A>>