Class: Dhall::TypeChecker::Literal

Inherits:
Object
  • Object
show all
Defined in:
lib/dhall/typecheck.rb

Instance Method Summary collapse

Constructor Details

#initialize(lit) ⇒ Literal

Returns a new instance of Literal.



110
111
112
113
114
# File 'lib/dhall/typecheck.rb', line 110

def initialize(lit)
	@lit = lit
	@type = Dhall::Variable[lit.class.name.split(/::/).last]
	@type = Builtins[@type.name.to_sym] || @type
end

Instance Method Details

#annotateObject



116
117
118
119
120
121
# File 'lib/dhall/typecheck.rb', line 116

def annotate(*)
	Dhall::TypeAnnotation.new(
		value: @lit,
		type:  @type
	)
end