stlc+lit: cleanup and comment

This commit is contained in:
Stephen Chang 2015-05-20 15:26:02 -04:00
parent adf34fd219
commit a4d7483f25
2 changed files with 10 additions and 7 deletions

View File

@ -10,9 +10,13 @@
(provide (all-from-out "stlc.rkt"))
;; Simply-Typed Lambda Calculus, plus numeric literals and primitives
;; forms from stlc.rkt
;; numeric literals
;; prim +
;; Types:
;; - types from stlc.rkt
;; - Int
;; Terms:
;; - terms from stlc.rkt
;; - numeric literals
;; - prim +
(define-base-type Int)

View File

@ -6,6 +6,9 @@
(provide #%module-begin #%top-interaction #%top require)
;; Simply-Typed Lambda Calculus
;; - no base type so cannot write any terms
;; Types: →
;; Terms:
;; - var
;; - multi-arg lambda
;; - multi-arg app
@ -27,10 +30,6 @@
(syntax->datum #'e_fn) (syntax->datum #'τ_fn))
#:with (τ ... τ_res) #'τ_fn
#:with ((e_arg- τ_arg) ...) (infers+erase #'(e_arg ...))
; #:fail-unless (= (stx-length #'(τ ...))
; (stx-length #'(τ_arg ...)))
; (format "Wrong number of arguments: given ~a, expected ~a\n"
; (stx-length #'(τ_arg ...)) (stx-length #'(τ ...)))
#:fail-unless (types=? #'(τ ...) #'(τ_arg ...))
(string-append
(format