arrows 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 +4 -4
- data/arrows.gemspec +1 -1
- data/lib/arrows/proc.rb +6 -0
- data/lib/arrows/version.rb +1 -1
- data/spec/arrows/proc_spec.rb +8 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb1d6b49e76a181dd98eb7bcde57d2f0c84b6602
|
4
|
+
data.tar.gz: 8b47d2612b4a9a869afa8b2e562c0cecb34368fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67cc2d97b5389402faa9c2158804ce58337a2922116441427a5bb376c76fa7b513c71e95d0a6802bbdda8d222cd503612a7fd017c989500823239820736abf12
|
7
|
+
data.tar.gz: 24efe4588f422bea91b67a15f44b45f0fc5e109c63f3766747cc72df8934ac9defbcaf51820e4f6528fcdf1c64af6a3f9fe91ceaf5d5a4835e5dda151f137f1e
|
data/arrows.gemspec
CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["Thomas Chen"]
|
10
10
|
spec.email = ["foxnewsnetwork@gmail.com"]
|
11
11
|
spec.summary = %q{Functional programming with composable, applicable, and arrowable functions.}
|
12
|
-
spec.description = %q{
|
12
|
+
spec.description = %q{Haskell-like Arrow functionality to procs, includes commonly useful functional junk such as function composition, fanout, functor map composition, parallel composition, fork composition, context lifting, and memoization.}
|
13
13
|
spec.homepage = "http://github.com/foxnewsnetwork/arrows"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
data/lib/arrows/proc.rb
CHANGED
data/lib/arrows/version.rb
CHANGED
data/spec/arrows/proc_spec.rb
CHANGED
@@ -5,6 +5,14 @@ RSpec.describe Arrows::Proc do
|
|
5
5
|
subject { Arrows::ID }
|
6
6
|
specify { should be_a Proc }
|
7
7
|
end
|
8
|
+
context 'memoize' do
|
9
|
+
let(:plus_random) { -> (x) { x + rand(9999999999) } }
|
10
|
+
let(:twelve) { Arrows.lift 4 }
|
11
|
+
let(:twenty_two) { (twelve >> plus_random).memoize }
|
12
|
+
subject { twenty_two.call }
|
13
|
+
specify { should eq twenty_two.call }
|
14
|
+
end
|
15
|
+
|
8
16
|
context '>> composition' do
|
9
17
|
let(:times2) { -> (x) { x * 2 } }
|
10
18
|
let(:plus3) { -> (x) { x + 3 } }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arrows
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Chen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -66,7 +66,9 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '2.3'
|
69
|
-
description:
|
69
|
+
description: Haskell-like Arrow functionality to procs, includes commonly useful functional
|
70
|
+
junk such as function composition, fanout, functor map composition, parallel composition,
|
71
|
+
fork composition, context lifting, and memoization.
|
70
72
|
email:
|
71
73
|
- foxnewsnetwork@gmail.com
|
72
74
|
executables: []
|