import {
  get,
  gets,
  modify,
  put
} from "./chunk-JYLODE2Y.mjs";
import {
  flow
} from "./chunk-ZI34HWXZ.mjs";
import {
  __export
} from "./chunk-QK4PKNB3.mjs";

// src/FromState.ts
var FromState_exports = {};
__export(FromState_exports, {
  chainStateK: () => chainStateK,
  fromStateK: () => fromStateK,
  get: () => get2,
  gets: () => gets2,
  modify: () => modify2,
  put: () => put2
});
function get2(F) {
  return () => F.fromState(get());
}
function put2(F) {
  return (s) => F.fromState(put(s));
}
function modify2(F) {
  return flow(modify, F.fromState);
}
function gets2(F) {
  return flow(gets, F.fromState);
}
function fromStateK(F) {
  return (f) => flow(f, F.fromState);
}
function chainStateK(F, M) {
  const fromStateKF = fromStateK(F);
  return (f) => (ma) => M.chain(ma, fromStateKF(f));
}

export {
  get2 as get,
  put2 as put,
  modify2 as modify,
  gets2 as gets,
  fromStateK,
  chainStateK,
  FromState_exports
};
