// Generated by ReScript, PLEASE EDIT WITH CARE
'use strict';

var Curry = require("bs-platform/lib/js/curry.js");
var IO$OptolithClient = require("../System/IO.bs.js");

function handle(f, x) {
  return x.catch(Curry.__1(f));
}

function handleE(x) {
  return x.then(function (x) {
                return IO$OptolithClient.Monad.pure({
                            TAG: /* Right */1,
                            _0: x
                          });
              }).catch(function (x) {
              return IO$OptolithClient.Monad.pure({
                          TAG: /* Left */0,
                          _0: x
                        });
            });
}

exports.handle = handle;
exports.handleE = handleE;
/* IO-OptolithClient Not a pure module */
