/** * @since 2.5.0 */ import { Applicative2C } from './Applicative' import { Apply2C } from './Apply' import { Bifunctor2 } from './Bifunctor' import { Chain2C } from './Chain' import { ChainRec2C } from './ChainRec' import { Comonad2 } from './Comonad' import { Foldable2 } from './Foldable' import { Functor2 } from './Functor' import { Monad2C } from './Monad' import { Monoid } from './Monoid' import { Semigroup } from './Semigroup' import { Semigroupoid2 } from './Semigroupoid' import { PipeableTraverse2, Traversable2 } from './Traversable' /** * @since 2.5.0 */ export declare function fst(ea: readonly [A, E]): A /** * @since 2.5.0 */ export declare function snd(ea: readonly [A, E]): E /** * @since 2.5.0 */ export declare const swap: (ea: readonly [A, E]) => readonly [E, A] /** * @category instances * @since 2.5.0 */ export declare function getApply(S: Semigroup): Apply2C /** * @category instances * @since 2.5.0 */ export declare function getApplicative(M: Monoid): Applicative2C /** * @category instances * @since 2.5.0 */ export declare function getChain(S: Semigroup): Chain2C /** * @category instances * @since 2.5.0 */ export declare function getMonad(M: Monoid): Monad2C /** * @category instances * @since 2.5.0 */ export declare function getChainRec(M: Monoid): ChainRec2C /** * Map a pair of functions over the two type arguments of the bifunctor. * * @category mapping * @since 2.5.0 */ export declare const bimap: ( mapSnd: (e: E) => G, mapFst: (a: A) => B ) => (fa: readonly [A, E]) => readonly [B, G] /** * Map a function over the first component of a `ReadonlyTuple`. * * This is the `map` operation of the `Functor` instance. * * @category mapping * @since 2.10.0 */ export declare const mapFst: (f: (a: A) => B) => (fa: readonly [A, E]) => readonly [B, E] /** * Map a function over the second component of a `ReadonlyTuple`. * * This is the `mapLeft` operation of the `Bifunctor` instance. * * @category mapping * @since 2.10.0 */ export declare const mapSnd: (f: (e: E) => G) => (fa: readonly [A, E]) => readonly [A, G] /** * @since 2.5.0 */ export declare const compose: (ab: readonly [B, A]) => (bc: readonly [C, B]) => readonly [C, A] /** * @since 2.5.0 */ export declare const extend: (f: (wa: readonly [A, E]) => B) => (wa: readonly [A, E]) => readonly [B, E] /** * @category Extract * @since 2.6.2 */ export declare const extract: (wa: readonly [A, E]) => A /** * @since 2.5.0 */ export declare const duplicate: (wa: readonly [A, E]) => readonly [readonly [A, E], E] /** * @category folding * @since 2.5.0 */ export declare const reduce: (b: B, f: (b: B, a: A) => B) => (fa: readonly [A, E]) => B /** * @category folding * @since 2.5.0 */ export declare const foldMap: (M: Monoid) => (f: (a: A) => M) => (fa: readonly [A, E]) => M /** * @category folding * @since 2.5.0 */ export declare const reduceRight: (b: B, f: (a: A, b: B) => B) => (fa: readonly [A, E]) => B /** * @category traversing * @since 2.6.3 */ export declare const traverse: PipeableTraverse2 /** * @category traversing * @since 2.6.3 */ export declare const sequence: Traversable2['sequence'] /** * @category type lambdas * @since 2.5.0 */ export declare const URI = 'ReadonlyTuple' /** * @category type lambdas * @since 2.5.0 */ export declare type URI = typeof URI declare module './HKT' { interface URItoKind2 { readonly [URI]: readonly [A, E] } } /** * @category instances * @since 2.7.0 */ export declare const Functor: Functor2 /** * @category mapping * @since 2.10.0 */ export declare const flap: (a: A) => (fab: readonly [(a: A) => B, E]) => readonly [B, E] /** * Alias of [`mapFst`](#mapfst). * * @category mapping * @since 2.5.0 */ export declare const map: (f: (a: A) => B) => (fa: readonly [A, E]) => readonly [B, E] /** * Alias of [`mapSnd`](#mapsnd). * * @category error handling * @since 2.5.0 */ export declare const mapLeft: (f: (e: E) => G) => (fa: readonly [A, E]) => readonly [A, G] /** * @category instances * @since 2.7.0 */ export declare const Bifunctor: Bifunctor2 /** * @category instances * @since 2.7.0 */ export declare const Semigroupoid: Semigroupoid2 /** * @category instances * @since 2.7.0 */ export declare const Comonad: Comonad2 /** * @category instances * @since 2.7.0 */ export declare const Foldable: Foldable2 /** * @category instances * @since 2.7.0 */ export declare const Traversable: Traversable2 /** * This instance is deprecated, use small, specific instances instead. * For example if a function needs a `Functor` instance, pass `RT.Functor` instead of `RT.readonlyTuple` * (where `RT` is from `import RT from 'fp-ts/ReadonlyTuple'`) * * @category zone of death * @since 2.5.0 * @deprecated */ export declare const readonlyTuple: Semigroupoid2 & Bifunctor2 & Comonad2 & Foldable2 & Traversable2