Sha256: 8b0d1ba48a01284f20be4a55b6f8d927f5b41b56d9e649a601bb9484b5af9ae4
Contents?: true
Size: 417 Bytes
Versions: 6
Compression:
Stored size: 417 Bytes
Contents
module Dry module Transaction # @api private class Stack RETURN = -> x { x } def initialize(steps) @stack = compile(steps) end def call(m) @stack.(m) end private def compile(steps) steps.reverse.reduce(RETURN) do |next_step, step| proc { |m| m.bind { |value| step.(value, next_step) } } end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems