import {
  __export
} from "./chunk-QK4PKNB3.mjs";

// src/Magma.ts
var Magma_exports = {};
__export(Magma_exports, {
  concatAll: () => concatAll,
  endo: () => endo,
  filterFirst: () => filterFirst,
  filterSecond: () => filterSecond,
  reverse: () => reverse
});
var reverse = (M) => ({
  concat: (first, second) => M.concat(second, first)
});
var filterFirst = (predicate) => (M) => ({
  concat: (first, second) => predicate(first) ? M.concat(first, second) : second
});
var filterSecond = (predicate) => (M) => ({
  concat: (first, second) => predicate(second) ? M.concat(first, second) : first
});
var endo = (f) => (M) => ({
  concat: (first, second) => M.concat(f(first), f(second))
});
var concatAll = (M) => (startWith) => (as) => as.reduce((a, acc) => M.concat(a, acc), startWith);

export {
  reverse,
  filterFirst,
  filterSecond,
  endo,
  concatAll,
  Magma_exports
};
