kansuu 0.0.4 → 0.0.5
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/bin/console +1 -0
- data/lib/kansuu/enum.rb +4 -4
- data/lib/kansuu/func.rb +8 -8
- data/lib/kansuu/obj.rb +2 -8
- data/lib/kansuu/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a795e15e6d1d38934d94a8e2b6c64c5a3ec28ee0
|
4
|
+
data.tar.gz: 95042b0bd22a8f3e50dcd7f662a4936019795f30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c81df2c50a498c55636023166adec4656b40d4555d99518d70f467122dc883b0a2f6d38fa0627f03705092421f4b8ce237d20e795331f42301cc4e0caf15f31a
|
7
|
+
data.tar.gz: 2d2e5c146dcabab22babbc9740ecf856ab93323c7e05c0f36de019f1ce7f92515a6e7ed52d5a5997dcb903414e2464c8d8cff9e1801be4bef4c8800cf1cb8db3
|
data/bin/console
CHANGED
data/lib/kansuu/enum.rb
CHANGED
@@ -94,14 +94,14 @@ module Kansuu::Enum
|
|
94
94
|
|
95
95
|
def zip_with
|
96
96
|
-> f, xs, ys {
|
97
|
-
xs.zip(ys).map &app[f]
|
97
|
+
xs.zip(ys).map &Kansuu::Func.app[f]
|
98
98
|
} % 3
|
99
99
|
end
|
100
100
|
|
101
101
|
def pick
|
102
102
|
-> ns, xs {
|
103
103
|
xs.values_at *ns
|
104
|
-
}
|
104
|
+
} % 2
|
105
105
|
end
|
106
106
|
|
107
107
|
def sum
|
@@ -113,8 +113,8 @@ module Kansuu::Enum
|
|
113
113
|
end
|
114
114
|
|
115
115
|
def initial
|
116
|
-
withl[length >> minus[1]] >>
|
117
|
-
|
116
|
+
Kansuu::Func.withl[Kansuu::Enum.length >> Kansuu::Num.minus[1]] >>
|
117
|
+
Kansuu::Func.app[Kansuu::Enum.take]
|
118
118
|
end
|
119
119
|
|
120
120
|
def tail; drop[1] end
|
data/lib/kansuu/func.rb
CHANGED
@@ -13,7 +13,7 @@ module Kansuu::Func
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def ap_all
|
16
|
-
-> fs, x { fs.map &(ap * x) } % 2
|
16
|
+
-> fs, x { p fs, x; fs.map &(Kansuu::Func.ap * x) } % 2
|
17
17
|
end
|
18
18
|
|
19
19
|
def ap_at
|
@@ -24,22 +24,22 @@ module Kansuu::Func
|
|
24
24
|
|
25
25
|
def ap_zip
|
26
26
|
-> fs, ys {
|
27
|
-
fs.zip(ys).map &app[ap]
|
27
|
+
fs.zip(ys).map &Kansuu::Func.app[Kansuu::Func.ap]
|
28
28
|
} % 2
|
29
29
|
end
|
30
30
|
|
31
31
|
def ap_head
|
32
|
-
ap_at[0]
|
32
|
+
Kansuu::Func.ap_at[0]
|
33
33
|
end
|
34
34
|
|
35
35
|
def ap_last
|
36
36
|
-> f, xs {
|
37
|
-
ap_at[xs.length - 1, f, xs]
|
38
|
-
}
|
37
|
+
Kansuu::Func.ap_at[xs.length - 1, f, xs]
|
38
|
+
} % 2
|
39
39
|
end
|
40
40
|
|
41
41
|
def dist
|
42
|
-
ap_all.flip
|
42
|
+
Kansuu::Func.ap_all.flip 2
|
43
43
|
end
|
44
44
|
|
45
45
|
def withl
|
@@ -64,13 +64,13 @@ module Kansuu::Func
|
|
64
64
|
|
65
65
|
def ap_arg
|
66
66
|
-> n, f, g {
|
67
|
-
args >> ap_at[n, f] >> app[g]
|
67
|
+
Kansuu::Func.args >> Kansuu::Func.ap_at[n, f] >> Kansuu::Func.app[g]
|
68
68
|
} % 3
|
69
69
|
end
|
70
70
|
|
71
71
|
def ap_find
|
72
72
|
-> f, g, xs {
|
73
|
-
ap_at[find_index[f, xs], g, xs]
|
73
|
+
Kansuu::Func.ap_at[Kansuu::Enum.find_index[f, xs], g, xs]
|
74
74
|
} % 3
|
75
75
|
end
|
76
76
|
|
data/lib/kansuu/obj.rb
CHANGED
@@ -14,13 +14,7 @@ module Kansuu::Obj
|
|
14
14
|
|
15
15
|
def disp
|
16
16
|
-> m, *args, o {
|
17
|
-
let
|
18
|
-
} % 3
|
19
|
-
end
|
20
|
-
|
21
|
-
def disp
|
22
|
-
-> m, *args, o {
|
23
|
-
o._(m)[*args]
|
17
|
+
Kansuu::Obj.let[o, m, *args]
|
24
18
|
} % 3
|
25
19
|
end
|
26
20
|
|
@@ -38,7 +32,7 @@ module Kansuu::Obj
|
|
38
32
|
|
39
33
|
def set_ap
|
40
34
|
-> k, f, o {
|
41
|
-
set[k, f[get[k, o]], o]
|
35
|
+
Kansuu::Obj.set[k, f[Kansuu::Obj.get[k, o]], o]
|
42
36
|
} % 3
|
43
37
|
end
|
44
38
|
|
data/lib/kansuu/version.rb
CHANGED