smullyan 0.1.2 → 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/lib/smullyan/birds/identity.rb +10 -2
- data/lib/smullyan/birds/phoenix.rb +16 -0
- data/lib/smullyan/version.rb +1 -1
- data/lib/smullyan.rb +1 -0
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3910bf99fff9838c5d4b545b1eea51db6a3b600bca46c2e885f8a7206d73534e
|
|
4
|
+
data.tar.gz: 891d205739931071eaa7d1513f2204dc118d908cd79b98454a08784566ad4ce0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 13ad3e2f46cc333691da7eb378e4610e66a4943b737192dfcc01f48572eb7e30ebde2db894a3275e35cd3c555a4be766f7ba001bed5be9b9ff519f4b02535806
|
|
7
|
+
data.tar.gz: 5b2fd590747a7a1cb9d295804560e01446f2d684edaacf00510500e24da3bafcc8b63864abb249424d79dd46aaf8d3712b81ef73ef6b5326f04e5cdb8cbe53e7
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require_relative 'starling'
|
|
4
|
+
require_relative 'kestrel'
|
|
5
|
+
|
|
3
6
|
module Smullyan
|
|
4
7
|
module Birds
|
|
5
8
|
# The Identity bird - returns its argument unchanged
|
|
6
9
|
# Identity x = x
|
|
7
|
-
|
|
10
|
+
|
|
11
|
+
# I is SKK
|
|
12
|
+
I_derived = S.(K).(K)
|
|
13
|
+
|
|
14
|
+
I_direct = ->(x) { x }
|
|
8
15
|
|
|
9
16
|
# Traditional combinator names
|
|
10
|
-
|
|
17
|
+
Identity = I_derived # I combinator
|
|
18
|
+
I = Identity
|
|
11
19
|
Idiot = Identity # Alternative name from Smullyan's book
|
|
12
20
|
end
|
|
13
21
|
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# # frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Smullyan
|
|
4
|
+
module Birds
|
|
5
|
+
# phoenix (or phi) applies takes 4 arguments in total
|
|
6
|
+
# it applies the fourth argument to the 2nd & 3rd, and then
|
|
7
|
+
# applies the results of those to the first
|
|
8
|
+
# phi xyzw = x(yw)(zw)
|
|
9
|
+
Phoenix = B.(B.(S)).(B)
|
|
10
|
+
|
|
11
|
+
Phoenix_direct = ->(x) { ->(y) { ->(z) { ->(w) { x.(y.(w)).(z.(w)) }}}}
|
|
12
|
+
|
|
13
|
+
Phi = Phoenix
|
|
14
|
+
Φ = Phoenix
|
|
15
|
+
end
|
|
16
|
+
end
|
data/lib/smullyan/version.rb
CHANGED
data/lib/smullyan.rb
CHANGED
|
@@ -13,6 +13,7 @@ require_relative 'smullyan/birds/why'
|
|
|
13
13
|
require_relative 'smullyan/birds/lark'
|
|
14
14
|
require_relative 'smullyan/birds/finch'
|
|
15
15
|
require_relative 'smullyan/birds/robin'
|
|
16
|
+
require_relative 'smullyan/birds/phoenix'
|
|
16
17
|
require_relative 'smullyan/configurable_birds'
|
|
17
18
|
|
|
18
19
|
module Smullyan
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: smullyan
|
|
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
|
- Phil Crissman
|
|
@@ -87,6 +87,7 @@ files:
|
|
|
87
87
|
- lib/smullyan/birds/kestrel.rb
|
|
88
88
|
- lib/smullyan/birds/lark.rb
|
|
89
89
|
- lib/smullyan/birds/mockingbird.rb
|
|
90
|
+
- lib/smullyan/birds/phoenix.rb
|
|
90
91
|
- lib/smullyan/birds/robin.rb
|
|
91
92
|
- lib/smullyan/birds/starling.rb
|
|
92
93
|
- lib/smullyan/birds/warbler.rb
|