Suggest replacing the combination of map
followed by mapLeft
(or vice-versa)
with bimap
.
💡 Fixable: This rule provides in-editor suggested fixes.
Examples of incorrect code for this rule:
import { pipe } from "fp-ts/function";
import { either } from "fp-ts";
pipe(
getResult(),
either.map((a) => a + 1),
either.mapLeft((e) => e + 1)
);
import { pipe } from "fp-ts/function";
import { either } from "fp-ts";
pipe(
getResult(),
either.mapLeft((e) => e + 1),
either.map((a) => a + 1)
);
Example of correct code for this rule:
import { pipe } from "fp-ts/function";
import { either } from "fp-ts";
pipe(
getResult(),
either.bimap(
(e) => e + 1,
(a) => a + 1
)
);