(bar . (abs Bool A))
(bar~0 . (abs A Bool))))
+(test (expand-pattern-matches '(let ([(foo x y) (foo 123 234)] [z (f 123)]) x))
+ '(let ([x (foo~0 (foo 123 234))]
+ [y (foo~1 (foo 123 234))]
+ [z (f 123)])
+ x))
+
(test-types (typecheck '((lambda (x) (+ ((lambda (y) (x y 3)) 5) 2))))
'(abs (abs Int (abs Int Int)) Int))
'Int)
- ; pattern matching
-(test (let-bindings '(let ([(foo x) a]) x))
- '((x (foo~0 a))))
-
-(test (let-bindings '(let ([x (foo 42)] [(foo y) x]) x))
- '((x (foo 42))
- (y (foo~0 x))))
-
; type annotations
(test (annotate-types