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

// src/Applicative.ts
var Applicative_exports = {};
__export(Applicative_exports, {
  getApplicativeComposition: () => getApplicativeComposition,
  getApplicativeMonoid: () => getApplicativeMonoid
});
function getApplicativeMonoid(F) {
  const f = getApplySemigroup(F);
  return (M) => ({
    concat: f(M).concat,
    empty: F.of(M.empty)
  });
}
function getApplicativeComposition(F, G) {
  const map = getFunctorComposition(F, G).map;
  const _ap = ap(F, G);
  return {
    map,
    of: (a) => F.of(G.of(a)),
    ap: (fgab, fga) => pipe(fgab, _ap(fga))
  };
}

export {
  getApplicativeMonoid,
  getApplicativeComposition,
  Applicative_exports
};
