daitai 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +56 -0
- data/lib/daitai.rb +4 -0
- data/lib/daitai/head.rb +9 -0
- data/lib/daitai/init.rb +9 -0
- data/lib/daitai/last.rb +9 -0
- data/lib/daitai/tail.rb +9 -0
- data/lib/daitai/version.rb +1 -1
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ef6ff2d48ef837e06b6c3ab0e191bf636a4276a
|
4
|
+
data.tar.gz: 24bbdb9ac09c9141b5af75a224d622fae88cf632
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77c652dc02cf78efc39eb852119cb3c36d78d00cf1da4fc602cc11d002f97174098712ac99b21d15a48f742042eefe21e76405406b2729196172399e4bfacfa2
|
7
|
+
data.tar.gz: 56c6ec334c3f9660ae6880e4cf5a57c95aeaafc6c7b3f73244166ffd1a2dee75f5992076adc25138e224ab55c3c0a61fff7d5222d627391cbe1f6203f3124f62
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -39,6 +39,9 @@ $ gem install daitai
|
|
39
39
|
* [compose](#compose-definition)
|
40
40
|
* [divide](#divide-definition)
|
41
41
|
* [filter](#filter-definition)
|
42
|
+
* [head](#head-definition)
|
43
|
+
* [init](#init-definition)
|
44
|
+
* [last](#last-definition)
|
42
45
|
* [map](#map-definition)
|
43
46
|
* [modulo](#modulo-definition)
|
44
47
|
* [multiply](#multiply-definition)
|
@@ -52,6 +55,7 @@ $ gem install daitai
|
|
52
55
|
* [sort](#sort-definition)
|
53
56
|
* [subtract](#subtract-definition)
|
54
57
|
* [sum](#sum-definition)
|
58
|
+
* [tail](#tail-definition)
|
55
59
|
|
56
60
|
- - -
|
57
61
|
|
@@ -166,6 +170,45 @@ only_even.([1, 2, 3, 4]) # => [2, 4]
|
|
166
170
|
|
167
171
|
- - -
|
168
172
|
|
173
|
+
<h4 id='head-definition'>
|
174
|
+
<code>head :: [a] -> a</code>
|
175
|
+
</h4>
|
176
|
+
|
177
|
+
Returns the first element of a list.
|
178
|
+
|
179
|
+
```ruby
|
180
|
+
Daitai.head.([1, 2, 3, 4]) # => 1
|
181
|
+
Daitai.head.("Ruby") # => "R"
|
182
|
+
```
|
183
|
+
|
184
|
+
- - -
|
185
|
+
|
186
|
+
<h4 id='init-definition'>
|
187
|
+
<code>init :: [a] -> [a]</code>
|
188
|
+
</h4>
|
189
|
+
|
190
|
+
Returns all the elements of a list except the last one.
|
191
|
+
|
192
|
+
```ruby
|
193
|
+
Daitai.init.([1, 2, 3, 4]) # => [1, 2, 3]
|
194
|
+
Daitai.init.("Ruby") # => "Rub"
|
195
|
+
```
|
196
|
+
|
197
|
+
- - -
|
198
|
+
|
199
|
+
<h4 id='last-definition'>
|
200
|
+
<code>last :: [a] -> a</code>
|
201
|
+
</h4>
|
202
|
+
|
203
|
+
Returns the last element of a list.
|
204
|
+
|
205
|
+
```ruby
|
206
|
+
Daitai.head.([1, 2, 3, 4]) # => 4
|
207
|
+
Daitai.head.("Ruby") # => "y"
|
208
|
+
```
|
209
|
+
|
210
|
+
- - -
|
211
|
+
|
169
212
|
<h4 id='map-definition'>
|
170
213
|
<code>map :: (a -> b) -> [a] -> [b]</code>
|
171
214
|
</h4>
|
@@ -346,6 +389,19 @@ Daitai.sum.([1, 2, 3, 4]) # => 10
|
|
346
389
|
|
347
390
|
- - -
|
348
391
|
|
392
|
+
<h4 id='tail-definition'>
|
393
|
+
<code>tail :: [a] -> [a]</code>
|
394
|
+
</h4>
|
395
|
+
|
396
|
+
Returns all the elements of a list except the first one.
|
397
|
+
|
398
|
+
```ruby
|
399
|
+
Daitai.tail.([1, 2, 3, 4]) # => [2, 3, 4]
|
400
|
+
Daitai.tail.("Ruby") # => "uby"
|
401
|
+
```
|
402
|
+
|
403
|
+
- - -
|
404
|
+
|
349
405
|
## Development
|
350
406
|
|
351
407
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/lib/daitai.rb
CHANGED
@@ -11,6 +11,9 @@ module Daitai
|
|
11
11
|
extend Compose
|
12
12
|
extend Divide
|
13
13
|
extend Filter
|
14
|
+
extend Head
|
15
|
+
extend Init
|
16
|
+
extend Last
|
14
17
|
extend Map
|
15
18
|
extend Modulo
|
16
19
|
extend Multiply
|
@@ -24,4 +27,5 @@ module Daitai
|
|
24
27
|
extend Sort
|
25
28
|
extend Subtract
|
26
29
|
extend Sum
|
30
|
+
extend Tail
|
27
31
|
end
|
data/lib/daitai/head.rb
ADDED
data/lib/daitai/init.rb
ADDED
data/lib/daitai/last.rb
ADDED
data/lib/daitai/tail.rb
ADDED
data/lib/daitai/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: daitai
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Walerian Sobczak
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03-
|
11
|
+
date: 2018-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -95,6 +95,9 @@ files:
|
|
95
95
|
- lib/daitai/compose.rb
|
96
96
|
- lib/daitai/divide.rb
|
97
97
|
- lib/daitai/filter.rb
|
98
|
+
- lib/daitai/head.rb
|
99
|
+
- lib/daitai/init.rb
|
100
|
+
- lib/daitai/last.rb
|
98
101
|
- lib/daitai/map.rb
|
99
102
|
- lib/daitai/modulo.rb
|
100
103
|
- lib/daitai/multiply.rb
|
@@ -108,6 +111,7 @@ files:
|
|
108
111
|
- lib/daitai/sort.rb
|
109
112
|
- lib/daitai/subtract.rb
|
110
113
|
- lib/daitai/sum.rb
|
114
|
+
- lib/daitai/tail.rb
|
111
115
|
- lib/daitai/version.rb
|
112
116
|
homepage: https://github.com/walerian777/daitai
|
113
117
|
licenses:
|