UNPKG

fp-ts

Version:

Functional programming in TypeScript

8 lines (7 loc) 341 B
import { getFunctorComposition } from './Functor'; export function getFunctorWithIndexComposition(F, G) { return { map: getFunctorComposition(F, G).map, mapWithIndex: function (fga, f) { return F.mapWithIndex(fga, function (fi, ga) { return G.mapWithIndex(ga, function (gi, a) { return f([fi, gi], a); }); }); } }; }