// Generated by purs version 0.14.5
"use strict";
var $foreign = require("./foreign.js");
var Data_Eq = require("../Data.Eq/index.js");
var Data_Function = require("../Data.Function/index.js");
var Data_Maybe = require("../Data.Maybe/index.js");
var Data_Ord = require("../Data.Ord/index.js");
var Data_Show = require("../Data.Show/index.js");
var toNullable = Data_Maybe.maybe($foreign["null"])($foreign.notNull);
var toMaybe = function (n) {
    return $foreign.nullable(n, Data_Maybe.Nothing.value, Data_Maybe.Just.create);
};
var showNullable = function (dictShow) {
    return {
        show: (function () {
            var $5 = Data_Maybe.maybe("null")(Data_Show.show(dictShow));
            return function ($6) {
                return $5(toMaybe($6));
            };
        })()
    };
};
var eqNullable = function (dictEq) {
    return {
        eq: Data_Function.on(Data_Eq.eq(Data_Maybe.eqMaybe(dictEq)))(toMaybe)
    };
};
var ordNullable = function (dictOrd) {
    return {
        compare: Data_Function.on(Data_Ord.compare(Data_Maybe.ordMaybe(dictOrd)))(toMaybe),
        Eq0: function () {
            return eqNullable(dictOrd.Eq0());
        }
    };
};
var eq1Nullable = {
    eq1: function (dictEq) {
        return Data_Eq.eq(eqNullable(dictEq));
    }
};
var ord1Nullable = {
    compare1: function (dictOrd) {
        return Data_Ord.compare(ordNullable(dictOrd));
    },
    Eq10: function () {
        return eq1Nullable;
    }
};
module.exports = {
    toMaybe: toMaybe,
    toNullable: toNullable,
    showNullable: showNullable,
    eqNullable: eqNullable,
    eq1Nullable: eq1Nullable,
    ordNullable: ordNullable,
    ord1Nullable: ord1Nullable,
    "null": $foreign["null"],
    notNull: $foreign.notNull
};
