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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NmNmMjExNjM2Njc1MzhhZmYzMzRlNmEwMGUyY2NmMzkwNDIwMDhlYg==
4
+ MDZmY2M0MDAwZTY3ZTk3MTBiYjFmMDJhMWVlNWMzZDhlNzQxOTBmYQ==
5
5
  data.tar.gz: !binary |-
6
- ZTRhNzk4N2I1MTFiM2E3NjQ0NmI5NzBmNWU4OWI1ZTBjNWIyN2ZiOQ==
6
+ YjBlYWUzMzFmZDMzNDJlYjlmMmRmNWIyODg5ZjA2YmMwOTk0Njk0Yw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MzRjOGYzOGI5YTEzM2UyZDU4YTM4MGMyNTRkZjk4NjQ3Y2IwZDY1NjRlZWYw
10
- N2UzYmI1ZGEwZjAwN2MwZWNkY2I3N2I4OGQ2NTZhYzZhYjJiMzZkNDI3OTJm
11
- NzQ3NzUzMGYxOWM1YmRjNDdlMjJkM2MzODQxY2M2MWU3ZTg1NDg=
9
+ ZDM4NjM5NjBmMjFlOThkMDU3OTczZjBiNzJhYmQ0YjFkMmE3ZjdhNWU5ZTk2
10
+ NWM0ZTk1MDFhN2U0OTgwNWMyZjYyMmU1MzZmMDBkMmMzNGJmNWZkNGFhNzY0
11
+ MWFiZjU3NTFmYzViNzc2NzU4ZWQyODc1YTQxMThmZWU5Y2Y1MTY=
12
12
  data.tar.gz: !binary |-
13
- MTQyNzQzM2M3NzZmMTQwYjQ3Y2JmMjQyMDRjNWY3ODdiMmU5ZTE0OGU2N2M4
14
- OWM3ZjhmYTMxZmY5ZjRkZTU3NTdjZjM0Y2RmMjJkNTBkMzc0ZTNlZjg1ZDU1
15
- MzdiZmYzOWZmNjI3MjQ4YzVkMTUxMWFiNTBmZjQxZWE2ZTVmOWE=
13
+ NjRlYWI0NzE5YzdlZDBjZTZiNWZjZjhiYTRkNjg5MDAzYzcwZmUxMmNkNjJi
14
+ Nzc3NzAwMmMxY2M0YTkzZWMxNDk4NTYyODUyNmQ5MDhkNmE3NWYyYTA5MzU2
15
+ ODhiMjBlMWQ0N2IwZmFkMzI1NGNhZGJmZDlkMGRmNGQ3Yzk2NzI=
@@ -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
@@ -132,7 +132,7 @@ class Some < Option
132
132
  end
133
133
 
134
134
  def to_s
135
- "Some(#{value})"
135
+ "some(#{value})"
136
136
  end
137
137
  end
138
138
 
@@ -208,7 +208,7 @@ class None < Option
208
208
  end
209
209
 
210
210
  def to_s
211
- 'None'
211
+ 'none'
212
212
  end
213
213
  end
214
214
 
@@ -302,6 +302,10 @@ class Sequence
302
302
  @enumerator.entries <=> other.enumerator.entries
303
303
  end
304
304
 
305
+ def to_s
306
+ "[#{self.take(100).reduce(join_with_sep(','))}]"
307
+ end
308
+
305
309
  private
306
310
  def seed(enumerator, fn)
307
311
  enumerator.rewind
@@ -1,7 +1,11 @@
1
1
  module Strings
2
2
  private
3
- def join(separator='')
4
- monoid(->(a, b) { "#{a}#{separator}#{b}" }, '')
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
@@ -1,5 +1,3 @@
1
- # encoding: UTF-8
2
-
3
1
  require_relative '../spec_helper'
4
2
 
5
3
  describe 'Either' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: totally_lazy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.34
4
+ version: 0.1.35
5
5
  platform: ruby
6
6
  authors:
7
7
  - Raymond Barlow