1// Generated by purs version 0.13.6
3var Control_Applicative = require("../Control.Applicative/index.js");
4var Control_Apply = require("../Control.Apply/index.js");
5var Control_Bind = require("../Control.Bind/index.js");
6var Control_Category = require("../Control.Category/index.js");
7var Data_Function = require("../Data.Function/index.js");
8var Data_Functor = require("../Data.Functor/index.js");
9var Nothing = (function () {
13 Nothing.value = new Nothing();
16var Just = (function () {
17 function Just(value0) {
20 Just.create = function (value0) {
21 return new Just(value0);
25var maybe = function (v) {
26 return function (v1) {
27 return function (v2) {
28 if (v2 instanceof Nothing) {
31 if (v2 instanceof Just) {
34 throw new Error("Failed pattern match at Data.Maybe (line 217, column 1 - line 217, column 51): " + [ v.constructor.name, v1.constructor.name, v2.constructor.name ]);
38var isNothing = maybe(true)(Data_Function["const"](false));
39var isJust = maybe(false)(Data_Function["const"](true));
40var functorMaybe = new Data_Functor.Functor(function (v) {
41 return function (v1) {
42 if (v1 instanceof Just) {
43 return new Just(v(v1.value0));
48var fromMaybe = function (a) {
49 return maybe(a)(Control_Category.identity(Control_Category.categoryFn));
51var fromJust = function (dictPartial) {
53 if (v instanceof Just) {
56 throw new Error("Failed pattern match at Data.Maybe (line 268, column 1 - line 268, column 46): " + [ v.constructor.name ]);
59var applyMaybe = new Control_Apply.Apply(function ($dollar__unused) {
62 return function (v1) {
63 if (v instanceof Just) {
64 return Data_Functor.map(functorMaybe)(v.value0)(v1);
66 if (v instanceof Nothing) {
69 throw new Error("Failed pattern match at Data.Maybe (line 67, column 1 - line 69, column 30): " + [ v.constructor.name, v1.constructor.name ]);
72var bindMaybe = new Control_Bind.Bind(function ($dollar__unused) {
75 return function (v1) {
76 if (v instanceof Just) {
79 if (v instanceof Nothing) {
82 throw new Error("Failed pattern match at Data.Maybe (line 125, column 1 - line 127, column 28): " + [ v.constructor.name, v1.constructor.name ]);
85var applicativeMaybe = new Control_Applicative.Applicative(function ($dollar__unused) {
96 functorMaybe: functorMaybe,
97 applyMaybe: applyMaybe,
98 applicativeMaybe: applicativeMaybe,
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list