class Dhall::Builtins::Natural_fold

Protected Instance Methods

uncurried_call(nat, type, f, z) click to toggle source
# File lib/dhall/builtins.rb, line 134
def uncurried_call(nat, type, f, z)
        return unfill(nat, type, f, z) unless nat.is_a?(Dhall::Natural)

        if nat.zero?
                z.normalize
        else
                f.call(Natural_fold.new.call(nat.pred, type, f, z))
        end
end