Class: Dhall::BuiltinFunction
Direct Known Subclasses
Dhall::Builtins::Double_show, Dhall::Builtins::Integer_show, Dhall::Builtins::Integer_toDouble, Dhall::Builtins::List_build, Dhall::Builtins::List_fold, Dhall::Builtins::List_head, Dhall::Builtins::List_indexed, Dhall::Builtins::List_last, Dhall::Builtins::List_length, Dhall::Builtins::List_reverse, Dhall::Builtins::Natural_build, Dhall::Builtins::Natural_even, Dhall::Builtins::Natural_fold, Dhall::Builtins::Natural_isZero, Dhall::Builtins::Natural_odd, Dhall::Builtins::Natural_show, Dhall::Builtins::Natural_subtract, Dhall::Builtins::Natural_toInteger, Dhall::Builtins::Optional_build, Dhall::Builtins::Optional_fold, Dhall::Builtins::Text_show
Instance Method Summary
collapse
Methods inherited from Expression
#&, #*, #+, #annotate, #as_dhall, #cache_key, #concat, decode, #deep_merge, #deep_merge_type, #dhall_eq, #digest, #fetch, #fusion, #merge, #normalize, #resolve, #shift, #slice, #substitute, #to_binary, #to_cbor, #to_proc, #to_s, #|
Instance Method Details
#as_json ⇒ Object
34
35
36
37
38
39
40
|
# File 'lib/dhall/builtins.rb', line 34
def as_json
if (unfilled = unfill) != self
unfilled.as_json
else
super
end
end
|
#call(*new_args) ⇒ Object
25
26
27
28
29
30
31
32
|
# File 'lib/dhall/builtins.rb', line 25
def call(*new_args)
args = partial_application + new_args
if args.length == method(:uncurried_call).arity
uncurried_call(*args)
else
with(partial_application: args)
end
end
|
#unfill(*args) ⇒ Object
19
20
21
22
23
|
# File 'lib/dhall/builtins.rb', line 19
def unfill(*args)
(args.empty? ? partial_application : args).reduce(self.class.new) do |f, arg|
Application.new(function: f, argument: arg)
end
end
|