"use strict";Object.defineProperty(exports, "__esModule", {value: true});

var _chunk6C3VEZWHjs = require('./chunk-6C3VEZWH.js');

// src/IORef.ts
var IORef_exports = {};
_chunk6C3VEZWHjs.__export.call(void 0, 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
   */
  
  /**
   * @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);
}





exports.IORef = IORef; exports.newIORef = newIORef; exports.IORef_exports = IORef_exports;
