kleisli-validation 0.0.3 → 0.0.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.
Files changed (2) hide show
  1. data/lib/kleisli/validation.rb +7 -3
  2. metadata +1 -1
@@ -1,16 +1,20 @@
1
- #require "kleisli/validation/version"
2
1
  require "kleisli"
3
2
  require "kleisli/semigroup_instances.rb"
4
3
 
5
4
  module Kleisli
6
5
  class Validation
7
- VERSION = "0.0.3"
6
+ VERSION = "0.0.4"
8
7
 
9
8
  class Success < Either::Right
10
9
 
11
10
  def *(other)
12
11
  if other.class == Success
13
- super
12
+ self >-> f {
13
+ f = f.to_proc
14
+ other >-> val {
15
+ Success(f.arity > 1 ? f.curry.call(val) : f.call(val))
16
+ }
17
+ }
14
18
  else
15
19
  other
16
20
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kleisli-validation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: