NoRecordConstructor.agda 362 B

123456789101112131415161718192021222324
  1. open import Common.Nat
  2. open import Common.IO
  3. open import Common.Unit
  4. record Test : Set where
  5. field
  6. a b c : Nat
  7. f : Test -> Nat
  8. f r = a + b + c
  9. where open Test r
  10. open Test
  11. g : Nat
  12. g = (f (record {a = 100; b = 120; c = 140})) + a m + b m + c m
  13. where m = record {c = 400; a = 200; b = 300}
  14. main : IO Unit
  15. main = printNat g
  16. -- Expected Output: 1260