class Dhall::Builtins::List_build

Public Instance Methods

fusion(*args) click to toggle source
Calls superclass method Dhall::Expression#fusion
# File lib/dhall/builtins.rb, line 186
def fusion(*args)
        _, arg, = args
        if arg.is_a?(Application) &&
           arg.function.is_a?(Application) &&
           arg.function.function == List_fold.new
                arg.argument
        else
                super
        end
end

Protected Instance Methods

cons(type) click to toggle source
# File lib/dhall/builtins.rb, line 207
def cons(type)
        Function.of_arguments(
                type,
                List.new.call(type.shift(1, "_", 0)),
                body: Dhall::List.of(Variable["_", 1]).concat(Variable["_"])
        )
end
uncurried_call(type, arg) click to toggle source
# File lib/dhall/builtins.rb, line 199
def uncurried_call(type, arg)
        arg.call(
                List.new.call(type),
                cons(type),
                EmptyList.new(element_type: type)
        )
end