Module: Dhall::TypeChecker::Forall::FunctionKind

Defined in:
lib/dhall/typecheck.rb

Defined Under Namespace

Classes: Polymorphic, Term

Class Method Summary collapse

Class Method Details

.for(inkind, outkind) ⇒ Object

Raises:

  • (TypeError)


840
841
842
843
844
845
846
847
848
849
850
851
852
# File 'lib/dhall/typecheck.rb', line 840

def self.for(inkind, outkind)
	if inkind.nil? || outkind.nil?
		raise TypeError, "FunctionType part of this is a term"
	end

	raise TypeError, "Dependent types are not allowed" if outkind > inkind

	if outkind.zero?
		Term.new
	else
		Polymorphic.new(inkind, outkind)
	end
end