diff --git a/spec/monads/either/right_spec.cr b/spec/monads/either/right_spec.cr index dff57fe..b761145 100644 --- a/spec/monads/either/right_spec.cr +++ b/spec/monads/either/right_spec.cr @@ -209,6 +209,14 @@ describe Monads::Right do end end + describe "#|" do + it "#| apply proc" do + monad = Monads::Right.new(1) | ->(x : Int32) { Monads::Right.new(x.to_s) } + monad.should eq(Monads::Right.new("1")) + end +end + + describe "self.return" do it "`self.return` return Right" do monad = Monads::Either.return(1) diff --git a/spec/monads_spec.cr b/spec/monads_spec.cr index fec558e..8208ec3 100644 --- a/spec/monads_spec.cr +++ b/spec/monads_spec.cr @@ -3,6 +3,6 @@ require "./monads/**" describe Monads do it "should have version" do - Monads::VERSION.should eq("0.5.1") + Monads::VERSION.should eq("0.7.0") end end diff --git a/src/monads.cr b/src/monads.cr index 575cf7e..9363c3b 100644 --- a/src/monads.cr +++ b/src/monads.cr @@ -3,5 +3,5 @@ require "./monads/*" module Monads # Requirements for 1.0.0 # - Documentation - VERSION = "0.5.1" + VERSION = "0.6.0" end diff --git a/src/monads/monad.cr b/src/monads/monad.cr index a062c72..e8551c9 100644 --- a/src/monads/monad.cr +++ b/src/monads/monad.cr @@ -16,10 +16,6 @@ module Monads self.bind(other) end - def |(&block : _ -> Monad(U)) forall U - self.bind(block) - end - def >>(other : Monad(U)) forall U other end