record update syntax

This commit is contained in:
2025-04-19 16:15:34 -07:00
parent d6156ebc79
commit 8faecfdf9b
10 changed files with 224 additions and 54 deletions

19
tests/RUTest.newt Normal file
View File

@@ -0,0 +1,19 @@
module RUTest
import Prelude
record Foo where
constructor MkFoo
bar : Nat
baz : Nat
blah : Foo Foo
blah x = [ bar := Z ] x
main : IO Unit
main = do
let x = blah $ MkFoo (S Z) (S (S Z))
printLn x.bar
-- this is unfortunate, it can't get record type from a meta
let x' = the Foo $ [ baz := Z ] x
printLn x'.baz