allow fst/snd to take multiple arguments

also succ though that won't be well typed
This commit is contained in:
rhiannon morris 2023-12-04 18:21:27 +01:00
parent e2ad18ff1f
commit 4291afd51b
2 changed files with 25 additions and 13 deletions

View file

@ -138,7 +138,15 @@ tests = "parser" :- [
parseMatch term "f @p"
`(DApp (V "f" {}) (V "p" {}) _),
parseMatch term "f x @p y"
`(App (DApp (App (V "f" {}) (V "x" {}) _) (V "p" {}) _) (V "y" {}) _)
`(App (DApp (App (V "f" {}) (V "x" {}) _) (V "p" {}) _) (V "y" {}) _),
parseMatch term "fst e"
`(Fst (V "e" {}) _),
parseMatch term "snd e"
`(Snd (V "e" {}) _),
parseMatch term "(fst e) x"
`(App (Fst (V "e" {}) _) (V "x" {}) _),
parseMatch term "fst e x"
`(App (Fst (V "e" {}) _) (V "x" {}) _)
],
"annotations" :- [