Class: Kleisli::Future
Class Method Summary collapse
Instance Method Summary collapse
- #>(f) ⇒ Object
- #await ⇒ Object
- #fmap(&f) ⇒ Object
-
#initialize(t) ⇒ Future
constructor
A new instance of Future.
Methods inherited from Monad
Constructor Details
#initialize(t) ⇒ Future
Returns a new instance of Future.
13 14 15 |
# File 'lib/kleisli/future.rb', line 13 def initialize(t) @t = t end |
Class Method Details
.lift(v = nil, &block) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/kleisli/future.rb', line 5 def self.lift(v=nil, &block) if block new(Thread.new(&block)) else new(Thread.new { v }) end end |