Class Lazy::Promise
In: lib/core/facets/lazy.rb
Parent: Object

Promise

A handle for a promised computation. They are transparent, so that in most cases, a promise can be used as a proxy for the computation‘s result object. The one exception is truth testing — a promise will always look true to Ruby, even if the actual result object is nil or false.

If you want to test the result for truth, get the unwrapped result object via Kernel.demand.

Classes and Modules

Module Lazy::Promise::DIVERGES

Constants

DIVERGES = lambda { raise DivergenceError.new }   Create this once here, rather than creating a proc object for every evaluation.

External Aliases

class -> __class__

[Validate]