totally_lazy 0.1.34 → 0.1.35
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 +8 -0
- data/lib/totally_lazy/option.rb +2 -2
- data/lib/totally_lazy/sequence.rb +4 -0
- data/lib/totally_lazy/strings.rb +6 -2
- 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
|
+
MDZmY2M0MDAwZTY3ZTk3MTBiYjFmMDJhMWVlNWMzZDhlNzQxOTBmYQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YjBlYWUzMzFmZDMzNDJlYjlmMmRmNWIyODg5ZjA2YmMwOTk0Njk0Yw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZDM4NjM5NjBmMjFlOThkMDU3OTczZjBiNzJhYmQ0YjFkMmE3ZjdhNWU5ZTk2
|
10
|
+
NWM0ZTk1MDFhN2U0OTgwNWMyZjYyMmU1MzZmMDBkMmMzNGJmNWZkNGFhNzY0
|
11
|
+
MWFiZjU3NTFmYzViNzc2NzU4ZWQyODc1YTQxMThmZWU5Y2Y1MTY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NjRlYWI0NzE5YzdlZDBjZTZiNWZjZjhiYTRkNjg5MDAzYzcwZmUxMmNkNjJi
|
14
|
+
Nzc3NzAwMmMxY2M0YTkzZWMxNDk4NTYyODUyNmQ5MDhkNmE3NWYyYTA5MzU2
|
15
|
+
ODhiMjBlMWQ0N2IwZmFkMzI1NGNhZGJmZDlkMGRmNGQ3Yzk2NzI=
|
data/lib/totally_lazy/either.rb
CHANGED
@@ -90,6 +90,10 @@ class Left < Either
|
|
90
90
|
def <=>(other)
|
91
91
|
@value <=> other.left_value
|
92
92
|
end
|
93
|
+
|
94
|
+
def to_s
|
95
|
+
"left(#{@value})"
|
96
|
+
end
|
93
97
|
end
|
94
98
|
|
95
99
|
class Right < Either
|
@@ -139,4 +143,8 @@ class Right < Either
|
|
139
143
|
def <=>(other)
|
140
144
|
@value <=> other.right_value
|
141
145
|
end
|
146
|
+
|
147
|
+
def to_s
|
148
|
+
"right(#{@value})"
|
149
|
+
end
|
142
150
|
end
|
data/lib/totally_lazy/option.rb
CHANGED
data/lib/totally_lazy/strings.rb
CHANGED
@@ -1,7 +1,11 @@
|
|
1
1
|
module Strings
|
2
2
|
private
|
3
|
-
def join
|
4
|
-
monoid(->(a, b) { "#{a}#{
|
3
|
+
def join
|
4
|
+
monoid(->(a, b) { "#{a}#{b}" }, '')
|
5
|
+
end
|
6
|
+
|
7
|
+
def join_with_sep(separator)
|
8
|
+
->(a, b) { "#{a}#{separator}#{b}" }
|
5
9
|
end
|
6
10
|
|
7
11
|
def to_characters
|