Class: Dhall::TypeChecker::Record
- Inherits:
-
Object
- Object
- Dhall::TypeChecker::Record
- Defined in:
- lib/dhall/typecheck.rb
Instance Method Summary collapse
- #annotate(context) ⇒ Object
-
#initialize(record) ⇒ Record
constructor
A new instance of Record.
Constructor Details
#initialize(record) ⇒ Record
Returns a new instance of Record.
521 522 523 |
# File 'lib/dhall/typecheck.rb', line 521 def initialize(record) @record = record end |
Instance Method Details
#annotate(context) ⇒ Object
525 526 527 528 529 530 531 532 533 534 535 536 |
# File 'lib/dhall/typecheck.rb', line 525 def annotate(context) arecord = @record.map do |k, v| [k, TypeChecker.for(v).annotate(context)] end Dhall::TypeAnnotation.new( value: arecord, type: TypeChecker.for(Dhall::RecordType.for(Hash[ arecord.record.map { |k, v| [k, v.type] } ])).annotate(context).value ) end |