/** * A `FunctorWithIndex` is a type constructor which supports a mapping operation `mapWithIndex`. * * `mapWithIndex` can be used to turn functions `i -> a -> b` into functions `f a -> f b` whose argument and return types use the type * constructor `f` to represent some computational context. * * Instances must satisfy the following laws: * * 1. Identity: `F.mapWithIndex(fa, (_i, a) => a) <-> fa` * 2. Composition: `F.mapWithIndex(fa, (_i, a) => bc(ab(a))) <-> F.mapWithIndex(F.mapWithIndex(fa, ab), bc)` * * @since 2.0.0 */ import { HKT, Kind, Kind2, Kind3, Kind4, URIS, URIS2, URIS3, URIS4 } from './HKT' import { Functor, Functor1, Functor2, Functor3, Functor4, Functor2C, FunctorComposition, FunctorComposition11, FunctorComposition12, FunctorComposition12C, FunctorComposition21, FunctorComposition2C1, FunctorComposition22, FunctorComposition22C, Functor3C } from './Functor' /** * @category type classes * @since 2.0.0 */ export interface FunctorWithIndex extends Functor { readonly mapWithIndex: (fa: HKT, f: (i: I, a: A) => B) => HKT } /** * @category type classes * @since 2.0.0 */ export interface FunctorWithIndex1 extends Functor1 { readonly mapWithIndex: (fa: Kind, f: (i: I, a: A) => B) => Kind } /** * @category type classes * @since 2.0.0 */ export interface FunctorWithIndex2 extends Functor2 { readonly mapWithIndex: (fa: Kind2, f: (i: I, a: A) => B) => Kind2 } /** * @category type classes * @since 2.0.0 */ export interface FunctorWithIndex2C extends Functor2C { readonly mapWithIndex: (fa: Kind2, f: (i: I, a: A) => B) => Kind2 } /** * @category type classes * @since 2.0.0 */ export interface FunctorWithIndex3 extends Functor3 { readonly mapWithIndex: (fa: Kind3, f: (i: I, a: A) => B) => Kind3 } /** * @category type classes * @since 2.2.0 */ export interface FunctorWithIndex3C extends Functor3C { readonly mapWithIndex: (fa: Kind3, f: (i: I, a: A) => B) => Kind3 } /** * @category type classes * @since 2.0.0 */ export interface FunctorWithIndex4 extends Functor4 { readonly mapWithIndex: (fa: Kind4, f: (i: I, a: A) => B) => Kind4 } /** * @since 2.0.0 */ export interface FunctorWithIndexComposition extends FunctorComposition { readonly mapWithIndex: (fga: HKT>, f: (i: [FI, GI], a: A) => B) => HKT> } /** * @since 2.0.0 */ export interface FunctorWithIndexComposition11 extends FunctorComposition11 { readonly mapWithIndex: (fa: Kind>, f: (i: [FI, GI], a: A) => B) => Kind> } /** * @since 2.0.0 */ export interface FunctorWithIndexComposition12 extends FunctorComposition12 { readonly mapWithIndex: (fa: Kind>, f: (i: [FI, GI], a: A) => B) => Kind> } /** * @since 2.0.0 */ export interface FunctorWithIndexComposition12C extends FunctorComposition12C { readonly mapWithIndex: (fa: Kind>, f: (i: [FI, GI], a: A) => B) => Kind> } /** * @since 2.0.0 */ export interface FunctorWithIndexComposition21 extends FunctorComposition21 { readonly mapWithIndex: (fa: Kind2>, f: (i: [FI, GI], a: A) => B) => Kind2> } /** * @since 2.0.0 */ export interface FunctorWithIndexComposition2C1 extends FunctorComposition2C1 { readonly mapWithIndex: (fa: Kind2>, f: (i: [FI, GI], a: A) => B) => Kind2> } /** * @since 2.0.0 */ export interface FunctorWithIndexComposition22 extends FunctorComposition22 { readonly mapWithIndex: ( fa: Kind2>, f: (i: [FI, GI], a: A) => B ) => Kind2> } /** * @since 2.0.0 */ export interface FunctorWithIndexComposition22C extends FunctorComposition22C { readonly mapWithIndex: ( fa: Kind2>, f: (i: [FI, GI], a: A) => B ) => Kind2> } /** * @since 2.0.0 */ export declare function getFunctorWithIndexComposition( F: FunctorWithIndex2, G: FunctorWithIndex2C ): FunctorWithIndexComposition22C export declare function getFunctorWithIndexComposition( F: FunctorWithIndex2, G: FunctorWithIndex2 ): FunctorWithIndexComposition22 export declare function getFunctorWithIndexComposition( F: FunctorWithIndex2C, G: FunctorWithIndex1 ): FunctorWithIndexComposition2C1 export declare function getFunctorWithIndexComposition( F: FunctorWithIndex2, G: FunctorWithIndex1 ): FunctorWithIndexComposition21 export declare function getFunctorWithIndexComposition( F: FunctorWithIndex1, G: FunctorWithIndex2C ): FunctorWithIndexComposition12C export declare function getFunctorWithIndexComposition( F: FunctorWithIndex1, G: FunctorWithIndex2 ): FunctorWithIndexComposition12 export declare function getFunctorWithIndexComposition( F: FunctorWithIndex1, G: FunctorWithIndex1 ): FunctorWithIndexComposition11 export declare function getFunctorWithIndexComposition( F: FunctorWithIndex, G: FunctorWithIndex ): FunctorWithIndexComposition