M lib/dhall/ast.rb => lib/dhall/ast.rb +4 -4
@@ 353,11 353,11 @@ module Dhall
end
def first
- OptionalNone.new(value_type: type)
+ OptionalNone.new(value_type: element_type)
end
def last
- OptionalNone.new(value_type: type)
+ OptionalNone.new(value_type: element_type)
end
def reverse
@@ 653,7 653,7 @@ module Dhall
Function.new(
var: k,
type: alternatives.fetch(k),
- body: Union.from(self, tag, Variable[k])
+ body: Union.from(self, k, Variable[k])
).normalize
rescue KeyError
block_given? ? yield : (default || raise)
@@ 902,7 902,7 @@ module Dhall
end
def headers
- super || EmptyList.new(type: HeaderType)
+ super || EmptyList.new(element_type: HeaderType)
end
def uri
M lib/dhall/builtins.rb => lib/dhall/builtins.rb +4 -4
@@ 204,7 204,7 @@ module Dhall
arg.call(
Variable["List"].call(type),
cons,
- EmptyList.new(type: type)
+ EmptyList.new(element_type: type)
)
end
end
@@ 358,7 358,7 @@ module Dhall
arg.call(
Variable["Optional"].call(type),
some,
- OptionalNone.new(type: type)
+ OptionalNone.new(value_type: type)
)
end
end
@@ 369,8 369,8 @@ module Dhall
Function.of_arguments(
type,
body: Optional.new(
- value: Variable["_"],
- type: type
+ value: Variable["_"],
+ value_type: type
)
)
end
M lib/dhall/normalize.rb => lib/dhall/normalize.rb +4 -4
@@ 237,25 237,25 @@ module Dhall
class List
def normalize
- super.with(type: nil)
+ super.with(element_type: nil)
end
end
class EmptyList
def normalize
- super.with(type: type.normalize)
+ super.with(element_type: element_type.normalize)
end
end
class Optional
def normalize
- with(value: value.normalize, type: nil)
+ with(value: value.normalize, value_type: nil)
end
end
class OptionalNone
def normalize
- with(type: type.normalize)
+ with(value_type: value_type.normalize)
end
end