class Dhall::Builtins::List_indexed
Protected Instance Methods
indexed_type(value_type)
click to toggle source
# File lib/dhall/builtins.rb, line 252 def indexed_type(value_type) RecordType.new( record: { "index" => Natural.new, "value" => value_type } ) end
uncurried_call(type, list)
click to toggle source
# File lib/dhall/builtins.rb, line 239 def uncurried_call(type, list) return unfill(type, list) unless list.is_a?(Dhall::List) list.map(type: indexed_type(type)) { |x, idx| Record.new( record: { "index" => Dhall::Natural.new(value: idx), "value" => x } ) }.normalize end