Passed
Push — master ( 122bb8...e9b69e )
by Pol
12:30
created
src/Numeral.php 1 patch
Spacing   +19 added lines, -20 removed lines patch added patch discarded remove patch
@@ -18,12 +18,12 @@  discard block
 block discarded – undo
18 18
      */
19 19
     public static function eight(): Closure
20 20
     {
21
-        return static fn (callable $s) => static fn ($z) => $s($s($s($s($s($s($s($s($z))))))));
21
+        return static fn(callable $s) => static fn($z) => $s($s($s($s($s($s($s($s($z))))))));
22 22
     }
23 23
 
24 24
     public static function exponentiation(): Closure
25 25
     {
26
-        return static fn (callable $f): Closure => static fn (callable $n): Closure => $n($f);
26
+        return static fn(callable $f): Closure => static fn(callable $n): Closure => $n($f);
27 27
     }
28 28
 
29 29
     /**
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
      */
32 32
     public static function five(): Closure
33 33
     {
34
-        return static fn (callable $s): Closure => static fn ($z) => $s($s($s($s($s($z)))));
34
+        return static fn(callable $s): Closure => static fn($z) => $s($s($s($s($s($z)))));
35 35
     }
36 36
 
37 37
     /**
@@ -39,17 +39,17 @@  discard block
 block discarded – undo
39 39
      */
40 40
     public static function four(): Closure
41 41
     {
42
-        return static fn (callable $s): Closure => static fn ($z) => $s($s($s($s($z))));
42
+        return static fn(callable $s): Closure => static fn($z) => $s($s($s($s($z))));
43 43
     }
44 44
 
45 45
     public static function minus(): Closure
46 46
     {
47
-        return static fn (callable $x): Closure => static fn (callable $y): Closure => $y(self::pred())($x);
47
+        return static fn(callable $x): Closure => static fn(callable $y): Closure => $y(self::pred())($x);
48 48
     }
49 49
 
50 50
     public static function multiply(): Closure
51 51
     {
52
-        return static fn (callable $x): Closure => static fn (callable $y): Closure => $x(self::plus()($y))(self::zero());
52
+        return static fn(callable $x): Closure => static fn(callable $y): Closure => $x(self::plus()($y))(self::zero());
53 53
     }
54 54
 
55 55
     /**
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
      */
58 58
     public static function nine(): Closure
59 59
     {
60
-        return static fn (callable $s): Closure => static fn ($z) => $s($s($s($s($s($s($s($s($s($z)))))))));
60
+        return static fn(callable $s): Closure => static fn($z) => $s($s($s($s($s($s($s($s($s($z)))))))));
61 61
     }
62 62
 
63 63
     /**
@@ -65,21 +65,20 @@  discard block
 block discarded – undo
65 65
      */
66 66
     public static function one(): Closure
67 67
     {
68
-        return static fn (callable $s): Closure => static fn ($z) => $s($z);
68
+        return static fn(callable $s): Closure => static fn($z) => $s($z);
69 69
     }
70 70
 
71 71
     public static function plus(): Closure
72 72
     {
73
-        return static fn (callable $x): Closure => static fn (callable $y): Closure => static fn ($s): Closure => static fn ($z) => $x($s)($y($s)($z));
73
+        return static fn(callable $x): Closure => static fn(callable $y): Closure => static fn($s): Closure => static fn($z) => $x($s)($y($s)($z));
74 74
     }
75 75
 
76 76
     public static function pred(): Closure
77 77
     {
78
-        return static fn (callable $n): Closure => static fn (callable $next): Closure => static fn ($first) => Pair::second()(
78
+        return static fn(callable $n): Closure => static fn(callable $next): Closure => static fn($first) => Pair::second()(
79 79
             $n(
80
-                static fn (callable $pair): Closure => Pair::first()($pair) ?
81
-                                        Pair::of()(false)($first) :
82
-                                        Pair::of()(false)($next(Pair::second()($pair)))
80
+                static fn(callable $pair): Closure => Pair::first()($pair) ?
81
+                                        Pair::of()(false)($first) : Pair::of()(false)($next(Pair::second()($pair)))
83 82
             )(Pair::of()(true)($first))
84 83
         );
85 84
     }
@@ -89,7 +88,7 @@  discard block
 block discarded – undo
89 88
      */
90 89
     public static function seven(): Closure
91 90
     {
92
-        return static fn (callable $s) => static fn ($z) => $s($s($s($s($s($s($s($z)))))));
91
+        return static fn(callable $s) => static fn($z) => $s($s($s($s($s($s($s($z)))))));
93 92
     }
94 93
 
95 94
     /**
@@ -97,12 +96,12 @@  discard block
 block discarded – undo
97 96
      */
98 97
     public static function six(): Closure
99 98
     {
100
-        return static fn (callable $s) => static fn ($z) => $s($s($s($s($s($s($z))))));
99
+        return static fn(callable $s) => static fn($z) => $s($s($s($s($s($s($z))))));
101 100
     }
102 101
 
103 102
     public static function succ(): Closure
104 103
     {
105
-        return static fn (callable $n): Closure => static fn (callable $s): Closure => static fn ($z) => $s($n($s)($z));
104
+        return static fn(callable $n): Closure => static fn(callable $s): Closure => static fn($z) => $s($n($s)($z));
106 105
     }
107 106
 
108 107
     /**
@@ -110,12 +109,12 @@  discard block
 block discarded – undo
110 109
      */
111 110
     public static function three(): Closure
112 111
     {
113
-        return static fn (callable $s) => static fn ($z) => $s($s($s($z)));
112
+        return static fn(callable $s) => static fn($z) => $s($s($s($z)));
114 113
     }
115 114
 
116 115
     public static function toInt(callable $numeral)
117 116
     {
118
-        return $numeral(static fn (int $n): int => $n + 1)(0);
117
+        return $numeral(static fn(int $n): int => $n + 1)(0);
119 118
     }
120 119
 
121 120
     /**
@@ -123,7 +122,7 @@  discard block
 block discarded – undo
123 122
      */
124 123
     public static function two(): Closure
125 124
     {
126
-        return static fn (callable $s) => static fn ($z) => $s($s($z));
125
+        return static fn(callable $s) => static fn($z) => $s($s($z));
127 126
     }
128 127
 
129 128
     /**
@@ -131,6 +130,6 @@  discard block
 block discarded – undo
131 130
      */
132 131
     public static function zero(): Closure
133 132
     {
134
-        return static fn (callable $s) => static fn ($z) => $z;
133
+        return static fn(callable $s) => static fn($z) => $z;
135 134
     }
136 135
 }
Please login to merge, or discard this patch.
src/Boolean.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -15,71 +15,71 @@
 block discarded – undo
15 15
 {
16 16
     public static function booleanToPrimitive(): Closure
17 17
     {
18
-        return static fn (callable $l): Closure => static fn (bool $m): Closure => static fn (bool $n): bool => $l($m)($n);
18
+        return static fn(callable $l): Closure => static fn(bool $m): Closure => static fn(bool $n): bool => $l($m)($n);
19 19
     }
20 20
 
21 21
     public static function CAnd(): Closure
22 22
     {
23
-        return static fn (callable $l): Closure => static fn (callable $c): Closure => $l($c)(self::CFalse());
23
+        return static fn(callable $l): Closure => static fn(callable $c): Closure => $l($c)(self::CFalse());
24 24
     }
25 25
 
26 26
     public static function CFalse(): Closure
27 27
     {
28
-        return static fn ($t): Closure => static fn ($f) => $f;
28
+        return static fn($t): Closure => static fn($f) => $f;
29 29
     }
30 30
 
31 31
     public static function CIf(): Closure
32 32
     {
33
-        return static fn (callable $if): Closure => self::CTrue()($if)(self::CFalse());
33
+        return static fn(callable $if): Closure => self::CTrue()($if)(self::CFalse());
34 34
     }
35 35
 
36 36
     public static function CNot(): Closure
37 37
     {
38
-        return static fn (callable $fn): Closure => $fn(self::CFalse())(self::CTrue());
38
+        return static fn(callable $fn): Closure => $fn(self::CFalse())(self::CTrue());
39 39
     }
40 40
 
41 41
     public static function COr(): Closure
42 42
     {
43
-        return static fn (callable $l): Closure => static fn (callable $c): Closure => $l(self::CTrue())($c);
43
+        return static fn(callable $l): Closure => static fn(callable $c): Closure => $l(self::CTrue())($c);
44 44
     }
45 45
 
46 46
     public static function CTrue(): Closure
47 47
     {
48
-        return static fn ($t): Closure => static fn ($f) => $t;
48
+        return static fn($t): Closure => static fn($f) => $t;
49 49
     }
50 50
 
51 51
     public static function CXor(): Closure
52 52
     {
53
-        return static fn (callable $a): Closure => static fn (callable $b) => ($a($b(self::CFalse())(self::CTrue())))($b(self::CTrue())(self::CFalse()));
53
+        return static fn(callable $a): Closure => static fn(callable $b) => ($a($b(self::CFalse())(self::CTrue())))($b(self::CTrue())(self::CFalse()));
54 54
     }
55 55
 
56 56
     public static function eq(): Closure
57 57
     {
58
-        return static fn ($a): Closure => static fn ($b) => self::CAnd()(self::lte()($a)($b))(self::lte()($b)($a));
58
+        return static fn($a): Closure => static fn($b) => self::CAnd()(self::lte()($a)($b))(self::lte()($b)($a));
59 59
     }
60 60
 
61 61
     public static function gt(): Closure
62 62
     {
63
-        return static fn ($a): Closure => static fn ($b) => self::CNot()(self::lte()($a)($b));
63
+        return static fn($a): Closure => static fn($b) => self::CNot()(self::lte()($a)($b));
64 64
     }
65 65
 
66 66
     public static function gte(): Closure
67 67
     {
68
-        return static fn ($a): Closure => static fn ($b) => self::isZero()(Numeral::minus()($b)($a));
68
+        return static fn($a): Closure => static fn($b) => self::isZero()(Numeral::minus()($b)($a));
69 69
     }
70 70
 
71 71
     public static function isZero(): Closure
72 72
     {
73
-        return static fn ($a) => $a(static fn () => self::CFalse())(self::CTrue());
73
+        return static fn($a) => $a(static fn() => self::CFalse())(self::CTrue());
74 74
     }
75 75
 
76 76
     public static function lt(): Closure
77 77
     {
78
-        return static fn ($a): Closure => static fn ($b) => self::CNot()(self::gte()($a)($b));
78
+        return static fn($a): Closure => static fn($b) => self::CNot()(self::gte()($a)($b));
79 79
     }
80 80
 
81 81
     public static function lte(): Closure
82 82
     {
83
-        return static fn ($a): Closure => static fn ($b) => self::isZero()(Numeral::minus()($a)($b));
83
+        return static fn($a): Closure => static fn($b) => self::isZero()(Numeral::minus()($a)($b));
84 84
     }
85 85
 }
Please login to merge, or discard this patch.
src/CList.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -11,26 +11,26 @@  discard block
 block discarded – undo
11 11
 {
12 12
     public static function cons()
13 13
     {
14
-        return static fn ($a): Closure => static fn ($b): Closure => Pair::of()(false)(Pair::of()($a)($b));
14
+        return static fn($a): Closure => static fn($b): Closure => Pair::of()(false)(Pair::of()($a)($b));
15 15
     }
16 16
 
17 17
     public static function foldl()
18 18
     {
19
-        return static fn ($f) => static fn ($a) => static fn ($xs) => self::foldr()(
20
-            static fn ($x) => static fn ($g) => static fn ($y) => $g($f($y)($x))
21
-        )(static fn ($x) => $x)($xs)($a);
19
+        return static fn($f) => static fn($a) => static fn($xs) => self::foldr()(
20
+            static fn($x) => static fn($g) => static fn($y) => $g($f($y)($x))
21
+        )(static fn($x) => $x)($xs)($a);
22 22
     }
23 23
 
24 24
     public static function foldr()
25 25
     {
26 26
         return Combinators::Y()(
27
-            static fn ($r) => static fn ($f) => static fn ($a) => static fn ($xs) => self::isNil()($xs) ? (static fn () => $a) : (static fn () => $f(self::head()($xs))($r($f)($a)(self::tail()($xs))))()
27
+            static fn($r) => static fn($f) => static fn($a) => static fn($xs) => self::isNil()($xs) ? (static fn() => $a) : (static fn() => $f(self::head()($xs))($r($f)($a)(self::tail()($xs))))()
28 28
         );
29 29
     }
30 30
 
31 31
     public static function head()
32 32
     {
33
-        return static fn ($a): Closure => Pair::first()(Pair::second()($a));
33
+        return static fn($a): Closure => Pair::first()(Pair::second()($a));
34 34
     }
35 35
 
36 36
     public static function isNil()
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 
41 41
     public static function length()
42 42
     {
43
-        return self::foldl()(static fn ($a) => static fn ($b) => Numeral::succ()($a))(Numeral::zero());
43
+        return self::foldl()(static fn($a) => static fn($b) => Numeral::succ()($a))(Numeral::zero());
44 44
     }
45 45
 
46 46
     public static function nil()
@@ -50,18 +50,18 @@  discard block
 block discarded – undo
50 50
 
51 51
     public static function range()
52 52
     {
53
-        return static fn ($a): Closure => static fn ($b) => Numeral::minus()(Numeral::succ()($b))($a)(static fn ($c) => CList::cons()(Numeral::minus()($b)(CList::length()($c)))($c))(CList::nil());
53
+        return static fn($a): Closure => static fn($b) => Numeral::minus()(Numeral::succ()($b))($a)(static fn($c) => CList::cons()(Numeral::minus()($b)(CList::length()($c)))($c))(CList::nil());
54 54
     }
55 55
 
56 56
     public static function repeat()
57 57
     {
58
-        return static fn ($a): Closure => static fn (callable $b) => $b(
59
-            static fn ($c) => CList::cons()($a)($c)
58
+        return static fn($a): Closure => static fn(callable $b) => $b(
59
+            static fn($c) => CList::cons()($a)($c)
60 60
         )(CList::nil());
61 61
     }
62 62
 
63 63
     public static function tail()
64 64
     {
65
-        return static fn ($a): Closure => Pair::second()(Pair::second()($a));
65
+        return static fn($a): Closure => Pair::second()(Pair::second()($a));
66 66
     }
67 67
 }
Please login to merge, or discard this patch.