// tracing: off
import { succeed } from "./core"
import { fail } from "./fail"
import { foldM_ } from "./foldM"
/**
 * Returns an effect whose failure and success channels have been mapped by
 * the specified pair of functions, `f` and `g`.
 */

export function bimap(f, g, __trace) {
  return (self) => bimap_(self, f, g, __trace)
}
/**
 * Returns an effect whose failure and success channels have been mapped by
 * the specified pair of functions, `f` and `g`.
 */

export function bimap_(self, f, g, __trace) {
  return foldM_(
    self,
    (e) => fail(f(e)),
    (a) => succeed(g(a)),
    __trace
  )
}
//# sourceMappingURL=bimap.js.map
