(load "ast.scm")
+(load "stdlib.scm")
(define (abs? t)
(and (list? t) (eq? (car t) 'abs)))
((res
(case (ast-type x)
('int-literal (make-result '() 'Int))
- ('bool-literal (make-result '() 'Bool))
('string-literal (make-result '() 'String))
('builtin (make-result '() (builtin-type x)))
(flat-map data-tors-type-env (program-data-layouts prog)))
; we typecheck the lambda calculus only (only single arg lambdas)
-(define (typecheck prog)
- (let ([expanded (expand-pattern-matches prog)])
+(define (typecheck prog-without-stdlib)
+ (let* ([prog (append stdlib prog-without-stdlib)]
+ [expanded (expand-pattern-matches prog)])
(cadr (check (program-data-layouts prog)
(init-adts-env expanded)
(normalize (program-body expanded))))))