text: // Generated by purs version 0.11.7
  "use strict";
  var Control_Applicative = require("../Control.Applicative");
  var Control_Bind = require("../Control.Bind");
  var Control_Monad_Aff = require("../Control.Monad.Aff");
  var Control_Monad_Aff_Internal = require("../Control.Monad.Aff.Internal");
  var Control_Monad_Eff = require("../Control.Monad.Eff");
  var Control_Monad_Eff_Exception = require("../Control.Monad.Eff.Exception");
  var Control_Semigroupoid = require("../Control.Semigroupoid");
  var Data_Function = require("../Data.Function");
  var Data_Function_Uncurried = require("../Data.Function.Uncurried");
  var Data_Maybe = require("../Data.Maybe");
  var Prelude = require("../Prelude");
  var Unsafe_Coerce = require("../Unsafe.Coerce");
  var fromAVBox = Unsafe_Coerce.unsafeCoerce;
  var killVar = function (q) {
      return function (e) {
          return fromAVBox(Control_Monad_Aff_Internal._killVar(Control_Monad_Aff.nonCanceler, q, e));
      };
  };
  var makeVar = fromAVBox(Control_Monad_Aff_Internal._makeVar(Control_Monad_Aff.nonCanceler));
  var peekVar = function (q) {
      return fromAVBox(Control_Monad_Aff_Internal._peekVar(Control_Monad_Aff.nonCanceler, q));
  };
  var putVar = function (q) {
      return function (a) {
          return fromAVBox(Control_Monad_Aff_Internal._putVar(Control_Monad_Aff.nonCanceler, q, a));
      };
  };
  var makeVar$prime = function (a) {
      return Control_Bind.bind(Control_Monad_Aff.bindAff)(makeVar)(function (v) {
          return Control_Bind.discard(Control_Bind.discardUnit)(Control_Monad_Aff.bindAff)(putVar(v)(a))(function () {
              return Control_Applicative.pure(Control_Monad_Aff.applicativeAff)(v);
          });
      });
  };
  var takeVar = function (q) {
      return fromAVBox(Control_Monad_Aff_Internal._takeVar(Control_Monad_Aff.nonCanceler, q));
  };
  var modifyVar = function (f) {
      return function (v) {
          return Control_Bind.bind(Control_Monad_Aff.bindAff)(takeVar(v))(function ($2) {
              return putVar(v)(f($2));
          });
      };
  };
  var tryPeekVar = function (q) {
      return fromAVBox(Control_Monad_Aff_Internal._tryPeekVar(Data_Maybe.Nothing.value, Data_Maybe.Just.create, Control_Monad_Aff.nonCanceler, q));
  };
  var tryTakeVar = function (q) {
      return fromAVBox(Control_Monad_Aff_Internal._tryTakeVar(Data_Maybe.Nothing.value, Data_Maybe.Just.create, Control_Monad_Aff.nonCanceler, q));
  };
  module.exports = {
      makeVar: makeVar,
      "makeVar'": makeVar$prime,
      takeVar: takeVar,
      peekVar: peekVar,
      putVar: putVar,
      modifyVar: modifyVar,
      killVar: killVar,
      tryTakeVar: tryTakeVar,
      tryPeekVar: tryPeekVar
  };
  