import * as HKT from './HKT' export interface FunctorWithIndex extends HKT.Base { readonly imap: MapWithIndexFn readonly imap_: MapWithIndexFn_ } export type FunctorWithIndexMin = { readonly imap_: MapWithIndexFn_ } export function FunctorWithIndex( F: FunctorWithIndexMin ): FunctorWithIndex { return HKT.instance({ imap_: F.imap_, imap: (f) => (fa) => F.imap_(fa, f) }) } export interface MapWithIndexFn { (f: (i: HKT.IndexFor, HKT.OrFix<'K', C, K>>, a: A) => B): < W, Q, X, I, S, R, E >( fa: HKT.Kind ) => HKT.Kind } export interface MapWithIndexFn_ { ( fa: HKT.Kind, f: (i: HKT.IndexFor, HKT.OrFix<'K', C, K>>, a: A) => B ): HKT.Kind }