totally_lazy 0.1.42 → 0.1.43
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/totally_lazy/either.rb +0 -8
- data/spec/totally_lazy/either_spec.rb +0 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NDEyYjgxYzJmODdjODYwNjAxNzhjYzIwZjgwYjk4NzJiMzE2ZDQ3MA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MTllYWU0ODRkNTQ3NjlkMTJlNGRmYjI5ZTBiZjlkMmI4NDNiNDVhMQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZjJiM2MxYzI0YjJmNWE3M2I3NmNjMTMyOGQwNWE0MjdmMDcyMDE5ZTE5N2Ix
|
10
|
+
MTA4NDk3NWZlNDkxODMyODAyM2IzYmQzYmRkYzRmYWZmZGQ5MDRjNmVmNWU3
|
11
|
+
MjBlMDZjYWZjMzgxMjE5Yjk2ZGY5OGE2MTJiZGVlOTMzMDJiNGI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZmE1Y2JhZWQ2MjAxNTJjM2UzYjcwMzc4ZWExMjRmMjA1MjJjMDc5ZGZlNjlh
|
14
|
+
N2YwMDgxYjRjNTFhNTE0OWNmZWFjOTY3OGZkMjliNDlmOTA1Zjg1M2YyNjQz
|
15
|
+
NTgyYThhMTBlYzA2MDk5MDNhZmMwMTAzYTRkMTAwY2I5ZjlmYmE=
|
data/lib/totally_lazy/either.rb
CHANGED
@@ -69,10 +69,6 @@ class Left < Either
|
|
69
69
|
raise NoSuchElementException.new
|
70
70
|
end
|
71
71
|
|
72
|
-
def map_lr(fn_left, fn_right)
|
73
|
-
fn_left.(@value)
|
74
|
-
end
|
75
|
-
|
76
72
|
def map_left(fn=nil, &block)
|
77
73
|
assert_funcs(fn, block_given?)
|
78
74
|
left(block_given? ? block.call(@value) : fn.(@value))
|
@@ -122,10 +118,6 @@ class Right < Either
|
|
122
118
|
right(block_given? ? block.call(@value) : fn.(@value))
|
123
119
|
end
|
124
120
|
|
125
|
-
def map_lr(fn_left, fn_right)
|
126
|
-
fn_right.(@value)
|
127
|
-
end
|
128
|
-
|
129
121
|
def map_left(fn=nil, &block)
|
130
122
|
assert_funcs(fn, block_given?)
|
131
123
|
self
|
@@ -25,8 +25,6 @@ describe 'Either' do
|
|
25
25
|
it 'should support map' do
|
26
26
|
expect(right(3).map(add(2))).to eq(right(5))
|
27
27
|
expect(right(3).map { |a| a+2 }).to eq(right(5))
|
28
|
-
expect(left(3).map_lr(add(2), nil)).to eq(5)
|
29
|
-
expect(right(3).map_lr(nil, add(2))).to eq(5)
|
30
28
|
end
|
31
29
|
|
32
30
|
it 'should support map_left' do
|