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

// src/IORef.ts
var IORef_exports = {};
__export(IORef_exports, {
  IORef: () => IORef,
  newIORef: () => newIORef
});
var IORef = class {
  constructor(value) {
    this.value = value;
    this.read = () => this.value;
    this.write = this.write.bind(this);
    this.modify = this.modify.bind(this);
  }
  /**
   * @remarks
   * Added in 1.0.0
   * @remarks
   * Original License: MIT – Copyright (c) 2017-present Giulio Canti
   * @public
   */
  read;
  /**
   * @remarks
   * Added in 1.0.0
   * @remarks
   * Original License: MIT – Copyright (c) 2017-present Giulio Canti
   * @public
   */
  write(a) {
    return () => {
      this.value = a;
    };
  }
  /**
   * @remarks
   * Added in 1.0.0
   * @remarks
   * Original License: MIT – Copyright (c) 2017-present Giulio Canti
   * @public
   */
  modify(f) {
    return () => {
      this.value = f(this.value);
    };
  }
};
function newIORef(a) {
  return () => new IORef(a);
}

export {
  IORef,
  newIORef,
  IORef_exports
};
