Package-level declarations

Types

Link copied to clipboard
data class Tuple2<A, B>(val first: A, val second: B) : K2<Tuple2.T, A, B>

A pair of values (first, second) encoded as a higher-kinded type.

Link copied to clipboard

Applicative instance for Tuple2; first components are combined with the Monoid S. Requires the Monoid class via type.

Link copied to clipboard

Applicative lifting helpers for Tuple2.

Link copied to clipboard

Bifoldable instance for Tuple2; folds the first component before the second.

Link copied to clipboard

Bifunctor instance for Tuple2.

Link copied to clipboard

Bitraversable instance for Tuple2; runs the effect of the first component before the second.

Link copied to clipboard

Comonad instance for Tuple2 (the environment comonad).

Link copied to clipboard

Copointed instance for Tuple2, extracting the second component.

Link copied to clipboard
interface Tuple2Eq<A, B> : Eq<Tuple2<A, B>>

Eq instance for Tuple2: both components equivalent under eqA and eqB.

Link copied to clipboard

Foldable1 instance for Tuple2, folding over its single second component.

Link copied to clipboard
interface Tuple2Functor<S> : Functor<K1<Tuple2.T, S>>

Functor instance for Tuple2, mapping the second component.

Link copied to clipboard
interface Tuple2Hash<A, B> : Hash<Tuple2<A, B>> , Tuple2Eq<A, B>

Hash instance for Tuple2, consistent with Tuple2Eq.

Link copied to clipboard

Monad instance for Tuple2 (writer-like); requires the Monoid class S.

Link copied to clipboard

Monadic lifting helpers for Tuple2.

Link copied to clipboard
interface Tuple2Order<A, B> : Order<Tuple2<A, B>>

Lexicographic Order instance for Tuple2: compares first with orderA, then second with orderB.

Link copied to clipboard
interface Tuple2Show<A, B> : Show<Tuple2<A, B>>

Show instance for Tuple2, rendered as Tuple2(a, b).

Link copied to clipboard

Traversable1 (and Traversable) instance for Tuple2, traversing its second component and keeping the first.

Functions

Link copied to clipboard
fun <S : Monoid<*, S>, A, B> Tuple2<S, A>.ap(type: Class<S>, f: Tuple2<S, (A) -> B>): Tuple2<S, B>

Applies the function in f, combining first components.

Link copied to clipboard
fun <S : Monoid<*, S>, A, B> Tuple2<S, A>.bind(type: Class<S>, f: (A) -> Tuple2<S, B>): Tuple2<S, B>

Sequences f, combining first components.

Link copied to clipboard
fun <A, B> Tuple2.Companion.eq(eqA: Eq<A>, eqB: Eq<B>): Eq<Tuple2<A, B>>

Returns the Eq instance for Tuple2 derived from the given element instances.

Link copied to clipboard
fun <A, B> Tuple2.Companion.hash(hashA: Hash<A>, hashB: Hash<B>): Hash<Tuple2<A, B>>

Returns the Hash instance for Tuple2 derived from the given element instances.

Link copied to clipboard
fun <A, B> Tuple2.Companion.order(orderA: Order<A>, orderB: Order<B>): Order<Tuple2<A, B>>

Returns the Order instance for Tuple2 derived from the given element instances.

Link copied to clipboard
fun <A, B> Tuple2.Companion.show(showA: Show<A>, showB: Show<B>): Show<Tuple2<A, B>>

Returns the Show instance for Tuple2 derived from the given element instances.

Link copied to clipboard
fun <A, B> Pair<A, B>.toTuple2(): Tuple2<A, B>

Converts a Kotlin Pair to Tuple2.