Sha256: 4c5b35a8857036f7b443c8f21df8a3bacac61cceb822db8cf1c91b30bd2a3c94
Contents?: true
Size: 442 Bytes
Versions: 13
Compression:
Stored size: 442 Bytes
Contents
class Mercury class Cps # Syntactic sugar for and_then chains. def self.seq(&block) s = Seq.new block.call(s.method(:chain)) s.m end class Seq def m @m ||= Cps.identity # we need an initial Cps to chain onto end def chain(proc=nil, &block) @m = m.and_then(&(proc || block)) end end end end class Method alias_method :en, :call # to be called `th.en` end
Version data entries
13 entries across 13 versions & 1 rubygems