Class: Dhallish::Types::Type

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(metadata = nil) ⇒ Type

Returns a new instance of Type.



12
13
14
# File 'lib/types.rb', line 12

def initialize(=nil)
	@metadata = 
end

Instance Attribute Details

#metadataObject

metadata contains information about that type, for example if its a list type. This is important for the static type checks.



11
12
13
# File 'lib/types.rb', line 11

def 
  @metadata
end

Instance Method Details

#==(otype) ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'lib/types.rb', line 16

def ==(otype)
	if !otype.is_a? Type
		false
	elsif @metadata != nil && otype. != nil
		@metadata == otype.
	else
		true
	end
end

#to_sObject



25
26
27
28
29
30
31
# File 'lib/types.rb', line 25

def to_s()
	if @metadata.nil? or @metadata.is_a? Unresolved
		"Type"
	else
		"Type(#{@metadata.to_s})"
	end
end