// ets_tracing: off import { pipe } from "../../Function/index.js" import type * as HKT from "../HKT/index.js" import type { Monad } from "../Monad/index.js" export function chainF( F: Monad ): ( f: (a: A) => HKT.Kind ) => ( fa: HKT.Kind< F, C, HKT.Intro, HKT.Intro, HKT.Intro, HKT.Intro, HKT.Intro, HKT.Intro, HKT.Intro, HKT.Intro, A > ) => HKT.Kind< F, C, HKT.Mix, HKT.Mix, HKT.Mix, HKT.Mix, HKT.Mix, HKT.Mix, HKT.Mix, HKT.Mix, B > export function chainF(F: Monad>) { return (f: (a: A) => HKT.HKT) => (x: HKT.HKT) => pipe(x, F.map(f), F.flatten) }