Class: Dhall::TypeChecker::LetIn
- Inherits:
-
Object
- Object
- Dhall::TypeChecker::LetIn
- Defined in:
- lib/dhall/typecheck.rb
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
- #annotate(context) ⇒ Object
-
#initialize(letin) ⇒ LetIn
constructor
A new instance of LetIn.
Constructor Details
#initialize(letin) ⇒ LetIn
Returns a new instance of LetIn.
857 858 859 860 |
# File 'lib/dhall/typecheck.rb', line 857 def initialize(letin) @letin = letin @let = @letin.let end |
Class Method Details
.for(letin) ⇒ Object
849 850 851 852 853 854 855 |
# File 'lib/dhall/typecheck.rb', line 849 def self.for(letin) if letin.let.type LetInAnnotated.new(letin) else LetIn.new(letin) end end |
Instance Method Details
#annotate(context) ⇒ Object
862 863 864 865 866 867 868 869 870 |
# File 'lib/dhall/typecheck.rb', line 862 def annotate(context) alet = @let.with(type: assign_type(context)) type = TypeChecker.for(@letin.eliminate).annotate(context).type abody = Dhall::TypeAnnotation.new(value: @letin.body, type: type) Dhall::TypeAnnotation.new( value: @letin.with(let: alet, body: abody), type: type ) end |