From c8b8932b7e6f336d2ca407b14d764755e62c10c3 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Sun, 31 Mar 2019 19:44:56 -0500 Subject: [PATCH] fix type => [value|element]_type --- lib/dhall/ast.rb | 8 ++++---- lib/dhall/builtins.rb | 8 ++++---- lib/dhall/normalize.rb | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/dhall/ast.rb b/lib/dhall/ast.rb index 8a8f7ea..ad149c8 100644 --- a/lib/dhall/ast.rb +++ b/lib/dhall/ast.rb @@ -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 diff --git a/lib/dhall/builtins.rb b/lib/dhall/builtins.rb index 3e5989b..3d9f571 100644 --- a/lib/dhall/builtins.rb +++ b/lib/dhall/builtins.rb @@ -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 diff --git a/lib/dhall/normalize.rb b/lib/dhall/normalize.rb index e033bb9..97c7cd0 100644 --- a/lib/dhall/normalize.rb +++ b/lib/dhall/normalize.rb @@ -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 -- 2.34.5