// Generated by purs version 0.14.5
"use strict";
var Control_Comonad = require("../Control.Comonad/index.js");
var Control_Extend = require("../Control.Extend/index.js");
var Data_Functor = require("../Data.Functor/index.js");
var Data_Tuple = require("../Data.Tuple/index.js");
var StoreT = function (x) {
    return x;
};
var runStoreT = function (v) {
    return v;
};
var newtypeStoreT = {
    Coercible0: function () {
        return undefined;
    }
};
var functorStoreT = function (dictFunctor) {
    return {
        map: function (f) {
            return function (v) {
                return StoreT(new Data_Tuple.Tuple(Data_Functor.map(dictFunctor)(function (h) {
                    return function ($25) {
                        return f(h($25));
                    };
                })(v.value0), v.value1));
            };
        }
    };
};
var extendStoreT = function (dictExtend) {
    return {
        extend: function (f) {
            return function (v) {
                return StoreT(new Data_Tuple.Tuple(Control_Extend.extend(dictExtend)(function (w$prime) {
                    return function (s$prime) {
                        return f(StoreT(new Data_Tuple.Tuple(w$prime, s$prime)));
                    };
                })(v.value0), v.value1));
            };
        },
        Functor0: function () {
            return functorStoreT(dictExtend.Functor0());
        }
    };
};
var comonadTransStoreT = {
    lower: function (dictComonad) {
        return function (v) {
            return Data_Functor.map((dictComonad.Extend0()).Functor0())(function (v1) {
                return v1(v.value1);
            })(v.value0);
        };
    }
};
var comonadStoreT = function (dictComonad) {
    return {
        extract: function (v) {
            return Control_Comonad.extract(dictComonad)(v.value0)(v.value1);
        },
        Extend0: function () {
            return extendStoreT(dictComonad.Extend0());
        }
    };
};
module.exports = {
    StoreT: StoreT,
    runStoreT: runStoreT,
    newtypeStoreT: newtypeStoreT,
    functorStoreT: functorStoreT,
    extendStoreT: extendStoreT,
    comonadStoreT: comonadStoreT,
    comonadTransStoreT: comonadTransStoreT
};
