git.iko.soy/rowtype-yoga/psfp
on f8046d6 help sign in
42 lines 1.3 kB history raw
1// Generated by purs version 0.13.6
2"use strict";
3var Control_Plus = require("../Control.Plus/index.js");
4var Data_Functor = require("../Data.Functor/index.js");
5var Data_Show = require("../Data.Show/index.js");
6var NonEmpty = (function () {
7 function NonEmpty(value0, value1) {
8 this.value0 = value0;
9 this.value1 = value1;
10 };
11 NonEmpty.create = function (value0) {
12 return function (value1) {
13 return new NonEmpty(value0, value1);
14 };
15 };
16 return NonEmpty;
17})();
18var singleton = function (dictPlus) {
19 return function (a) {
20 return new NonEmpty(a, Control_Plus.empty(dictPlus));
21 };
22};
23var showNonEmpty = function (dictShow) {
24 return function (dictShow1) {
25 return new Data_Show.Show(function (v) {
26 return "(NonEmpty " + (Data_Show.show(dictShow)(v.value0) + (" " + (Data_Show.show(dictShow1)(v.value1) + ")")));
27 });
28 };
29};
30var functorNonEmpty = function (dictFunctor) {
31 return new Data_Functor.Functor(function (f) {
32 return function (m) {
33 return new NonEmpty(f(m.value0), Data_Functor.map(dictFunctor)(f)(m.value1));
34 };
35 });
36};
37module.exports = {
38 NonEmpty: NonEmpty,
39 singleton: singleton,
40 showNonEmpty: showNonEmpty,
41 functorNonEmpty: functorNonEmpty
42};