@@ -30,46 +30,53 @@ public function __construct($deferred)
30
30
$ this ->deferred = $ deferred ;
31
31
}
32
32
33
+ #[\Override]
33
34
public function map (callable $ map ): self
34
35
{
35
36
$ captured = $ this ->capture ();
36
37
37
38
return new self (static fn () => self ::detonate ($ captured )->map ($ map ));
38
39
}
39
40
41
+ #[\Override]
40
42
public function flatMap (callable $ map ): Either
41
43
{
42
44
$ captured = $ this ->capture ();
43
45
44
46
return Either::defer (static fn () => self ::detonate ($ captured )->flatMap ($ map ));
45
47
}
46
48
49
+ #[\Override]
47
50
public function leftMap (callable $ map ): self
48
51
{
49
52
$ captured = $ this ->capture ();
50
53
51
54
return new self (static fn () => self ::detonate ($ captured )->leftMap ($ map ));
52
55
}
53
56
57
+ #[\Override]
54
58
public function match (callable $ right , callable $ left )
55
59
{
56
60
return $ this ->unwrap ()->match ($ right , $ left );
57
61
}
58
62
63
+ #[\Override]
59
64
public function otherwise (callable $ otherwise ): Either
60
65
{
61
66
$ captured = $ this ->capture ();
62
67
63
68
return Either::defer (static fn () => self ::detonate ($ captured )->otherwise ($ otherwise ));
64
69
}
65
70
71
+ #[\Override]
66
72
public function filter (callable $ predicate , callable $ otherwise ): Implementation
67
73
{
68
74
$ captured = $ this ->capture ();
69
75
70
76
return new self (static fn () => self ::detonate ($ captured )->filter ($ predicate , $ otherwise ));
71
77
}
72
78
79
+ #[\Override]
73
80
public function maybe (): Maybe
74
81
{
75
82
$ captured = $ this ->capture ();
@@ -80,18 +87,21 @@ public function maybe(): Maybe
80
87
/**
81
88
* @return Either<L1, R1>
82
89
*/
90
+ #[\Override]
83
91
public function memoize (): Either
84
92
{
85
93
return $ this ->unwrap ();
86
94
}
87
95
96
+ #[\Override]
88
97
public function flip (): self
89
98
{
90
99
$ captured = $ this ->capture ();
91
100
92
101
return new self (static fn () => self ::detonate ($ captured )->flip ());
93
102
}
94
103
104
+ #[\Override]
95
105
public function eitherWay (callable $ right , callable $ left ): Either
96
106
{
97
107
$ captured = $ this ->capture ();
0 commit comments