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.
947 948 949 950 |
# File 'lib/dhall/typecheck.rb', line 947 def initialize(letin) @letin = letin @let = @letin.let end |
Class Method Details
.for(letin) ⇒ Object
939 940 941 942 943 944 945 |
# File 'lib/dhall/typecheck.rb', line 939 def self.for(letin) if letin.let.type LetInAnnotated.new(letin) else LetIn.new(letin) end end |
Instance Method Details
#annotate(context) ⇒ Object
952 953 954 955 956 957 958 959 960 |
# File 'lib/dhall/typecheck.rb', line 952 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 |