UNPKG

1.26 kBJavaScriptView Raw
1// Generated by CoffeeScript 1.10.0
2(function() {
3 var abs, add, curry, div, eq, even, gt, gte, lt, lte, max, min, mod, mul, negate, neq, odd, partial, pow, ref, sub;
4
5 ref = require("fairmont-core"), curry = ref.curry, partial = ref.partial, negate = ref.negate;
6
7 eq = curry(function(x, y) {
8 return x === y;
9 });
10
11 neq = curry(function(x, y) {
12 return x !== y;
13 });
14
15 gte = curry(function(x, y) {
16 return y >= x;
17 });
18
19 lte = curry(function(x, y) {
20 return y <= x;
21 });
22
23 gt = curry(function(x, y) {
24 return y > x;
25 });
26
27 lt = curry(function(x, y) {
28 return y < x;
29 });
30
31 add = curry(function(x, y) {
32 return x + y;
33 });
34
35 sub = curry(function(x, y) {
36 return y - x;
37 });
38
39 mul = curry(function(x, y) {
40 return x * y;
41 });
42
43 div = curry(function(x, y) {
44 return y / x;
45 });
46
47 mod = curry(function(x, y) {
48 return y % x === 0;
49 });
50
51 even = mod(2);
52
53 odd = negate(even);
54
55 min = Math.min, max = Math.max, abs = Math.abs, pow = Math.pow;
56
57 module.exports = {
58 eq: eq,
59 neq: neq,
60 gt: gt,
61 lt: lt,
62 gte: gte,
63 lte: lte,
64 add: add,
65 sub: sub,
66 mul: mul,
67 div: div,
68 mod: mod,
69 even: even,
70 odd: odd,
71 min: min,
72 max: max,
73 abs: abs
74 };
75
76}).call(this);