// Generated by purs version 0.14.5
"use strict";
var $foreign = require("./foreign.js");
var Control_Applicative = require("../Control.Applicative/index.js");
var Control_Apply = require("../Control.Apply/index.js");
var Control_Category = require("../Control.Category/index.js");
var Data_Function = require("../Data.Function/index.js");
var Data_Functor = require("../Data.Functor/index.js");
var Type_Proxy = require("../Type.Proxy/index.js");
var discard = function (dict) {
    return dict.discard;
};
var bindProxy = {
    bind: function (v) {
        return function (v1) {
            return Type_Proxy["Proxy"].value;
        };
    },
    Apply0: function () {
        return Control_Apply.applyProxy;
    }
};
var bindFn = {
    bind: function (m) {
        return function (f) {
            return function (x) {
                return f(m(x))(x);
            };
        };
    },
    Apply0: function () {
        return Control_Apply.applyFn;
    }
};
var bindArray = {
    bind: $foreign.arrayBind,
    Apply0: function () {
        return Control_Apply.applyArray;
    }
};
var bind = function (dict) {
    return dict.bind;
};
var bindFlipped = function (dictBind) {
    return Data_Function.flip(bind(dictBind));
};
var composeKleisliFlipped = function (dictBind) {
    return function (f) {
        return function (g) {
            return function (a) {
                return bindFlipped(dictBind)(f)(g(a));
            };
        };
    };
};
var composeKleisli = function (dictBind) {
    return function (f) {
        return function (g) {
            return function (a) {
                return bind(dictBind)(f(a))(g);
            };
        };
    };
};
var discardProxy = {
    discard: function (dictBind) {
        return bind(dictBind);
    }
};
var discardProxy2 = {
    discard: function (dictBind) {
        return bind(dictBind);
    }
};
var discardProxy3 = {
    discard: function (dictBind) {
        return bind(dictBind);
    }
};
var discardUnit = {
    discard: function (dictBind) {
        return bind(dictBind);
    }
};
var ifM = function (dictBind) {
    return function (cond) {
        return function (t) {
            return function (f) {
                return bind(dictBind)(cond)(function (cond$prime) {
                    if (cond$prime) {
                        return t;
                    };
                    return f;
                });
            };
        };
    };
};
var join = function (dictBind) {
    return function (m) {
        return bind(dictBind)(m)(Control_Category.identity(Control_Category.categoryFn));
    };
};
module.exports = {
    bind: bind,
    bindFlipped: bindFlipped,
    discard: discard,
    join: join,
    composeKleisli: composeKleisli,
    composeKleisliFlipped: composeKleisliFlipped,
    ifM: ifM,
    bindFn: bindFn,
    bindArray: bindArray,
    bindProxy: bindProxy,
    discardUnit: discardUnit,
    discardProxy: discardProxy,
    discardProxy2: discardProxy2,
    discardProxy3: discardProxy3,
    liftA1: Control_Applicative.liftA1,
    pure: Control_Applicative.pure,
    unless: Control_Applicative.unless,
    when: Control_Applicative.when,
    apply: Control_Apply.apply,
    map: Data_Functor.map,
    "void": Data_Functor["void"]
};
