(case t
('int #t)
('bool #t)
+ ('void #t)
(else #f)))
(define (pretty-type t)
('! '(abs bool bool))
('= '(abs int (abs int bool)))
('bool->int '(abs bool int))
+ ('print '(abs string void))
(else #f)))
; we typecheck the lambda calculus only (only single arg lambdas)
(case (ast-type x)
('int-literal (list '() 'int))
('bool-literal (list '() 'bool))
+ ('string-literal (list '() 'string))
('builtin (list '() (builtin-type x)))
('if