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.
511 512 513 |
# File 'lib/dhall/typecheck.rb', line 511 def initialize(record) @record = record end |
Instance Method Details
#annotate(context) ⇒ Object
515 516 517 518 519 520 521 522 523 524 525 526 |
# File 'lib/dhall/typecheck.rb', line 515 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 |