-(test-types (typecheck '(lambda (x) (+ ((lambda (y) (x y 3)) 5) 2)))
- '(abs (abs int (abs int int)) int))
+(test (data-tors '(A . ((foo Int Bool)
+ (bar Bool))))
+ '((foo (A foo constructor)
+ abs Int (abs Bool A))
+ (foo~0 (A foo 0) abs A Int)
+ (foo~1 (A foo 1) abs A Bool)
+ (bar (A bar constructor) abs Bool A)
+ (bar~0 (A bar 0) abs A Bool)))
+
+(test (data-tors-type-env
+ '(A . ((foo Int Bool)
+ (bar Bool))))
+ '((foo . (abs Int (abs Bool A)))
+ (foo~0 . (abs A Int))
+ (foo~1 . (abs A Bool))
+ (bar . (abs Bool A))
+ (bar~0 . (abs A Bool))))
+
+(test-types (typecheck '((lambda (x) (+ ((lambda (y) (x y 3)) 5) 2))))
+ '(abs (abs Int (abs Int Int)) Int))