import {
  getFunctorComposition
} from "./chunk-WKK6AYQI.mjs";
import {
  pipe
} from "./chunk-ZI34HWXZ.mjs";
import {
  __export
} from "./chunk-QK4PKNB3.mjs";

// src/FunctorWithIndex.ts
var FunctorWithIndex_exports = {};
__export(FunctorWithIndex_exports, {
  getFunctorWithIndexComposition: () => getFunctorWithIndexComposition,
  mapWithIndex: () => mapWithIndex
});
function mapWithIndex(F, G) {
  return (f) => (fa) => F.mapWithIndex(fa, (i, ga) => G.mapWithIndex(ga, (j, a) => f([i, j], a)));
}
function getFunctorWithIndexComposition(F, G) {
  const map = getFunctorComposition(F, G).map;
  const _mapWithIndex = mapWithIndex(F, G);
  return {
    map,
    mapWithIndex: (fga, f) => pipe(fga, _mapWithIndex(f))
  };
}

export {
  mapWithIndex,
  getFunctorWithIndexComposition,
  FunctorWithIndex_exports
};
