Class: Dhall::Operator::NotEqual

Inherits:
Dhall::Operator show all
Defined in:
lib/dhall/ast.rb,
lib/dhall/normalize.rb

Constant Summary

Constants inherited from Dhall::Operator

OPERATORS

Instance Method Summary collapse

Methods inherited from Dhall::Operator

#as_json, decode

Methods inherited from Expression

#&, #*, #+, #annotate, #as_dhall, #cache_key, #call, #concat, decode, #deep_merge, #deep_merge_type, #dhall_eq, #digest, #fetch, #fusion, #merge, #resolve, #shift, #slice, #substitute, #to_binary, #to_cbor, #to_proc, #to_s, #|

Instance Method Details

#normalizeObject



182
183
184
185
186
187
188
189
190
191
192
193
# File 'lib/dhall/normalize.rb', line 182

def normalize
	normalized = super
	if normalized.lhs == Bool.new(value: false)
		normalized.rhs
	elsif normalized.rhs == Bool.new(value: false)
		normalized.lhs
	elsif normalized.lhs == normalized.rhs
		Bool.new(value: false)
	else
		normalized
	end
end