functions 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/functions/prelude_lambda/basic.rb +2 -2
- data/lib/functions/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZTA3YWEwZTYwYTVhY2FhOTRmMjJkMjBlMTQ5YzZmMmQ1MzMzZjNmYg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MGFmMThjZWI2ZDEzNGJmNzE4NDVlYzI1ZWYzYjhlMzdjNDE5MDkwYw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NzJjZDAwMTM0NjkzZThkNzVmMmJhNGUwODRlNTk2MTFmNTRmNjU3NWEwMjcy
|
10
|
+
YTQ5ZDNiMjhhMWMzMThkMDg5NDljMzZiN2JiOWMyYWM0ZWE5YzdjYzNjZjNh
|
11
|
+
MjQ2MDk4ZjliMTU2Nzc3MDIxYzczYWU2NzgwNTE2YzdjYjM0ZGQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
M2UwMWRlN2M5NmE5ODc0NDkxZjBhNzYxMTZlMjE3MDZmNzRmMWFlN2M5NTY3
|
14
|
+
ZDc1Y2ViNWZmNjIwOWIxM2U1N2VmYWMwM2VhNWNjMWIxNGJhOGEwYjFlNGRl
|
15
|
+
YjgzOWZkNDY2YzY0YzU2ZTJhMjNiYTZjMWQ5NTZkZTZiMTQ4MzU=
|
@@ -95,14 +95,14 @@ module Functions
|
|
95
95
|
|
96
96
|
Group = ->(f,a) { a.group_by(&f) }.curry # functional friend
|
97
97
|
|
98
|
-
Partition = ->(f) { Group.(f)
|
98
|
+
Partition = ->(f) { Group.(f) < Send.(:values) } # functional friend
|
99
99
|
|
100
100
|
FromTo = ->(from) { ->(to) { Range.new(from, to) } }
|
101
101
|
|
102
102
|
FromOneTo = FromTo.(1)
|
103
103
|
|
104
104
|
Count_By = ->(f,a) { a.inject( Hash.new(0) ) { |h,e| h[f.(e)] += 1; h } }.curry
|
105
|
-
# count_by = ->(f) { group_by.( f )
|
105
|
+
# count_by = ->(f) { group_by.( f ) < map_hash.( send.(:length) ) }
|
106
106
|
|
107
107
|
Count = ->(a) { a.inject( Hash.new(0) ) { |h,e| h[e] += 1; h } } # probably a bit faster
|
108
108
|
# count = count_by.(identity) # alternative definition (generic)
|
data/lib/functions/version.rb
CHANGED