Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (provide
- (contract-out
- #:forall A
- #:forall B
- [map (-> (-> A B) (listof A) (listof B))]))
- (define (map f l)
- (match l
- [(list) empty]
- [(list h t ...) (cons h (map f t))])) ; <- Error should break internal contract by simply cons-ing h.
- (map (lambda (x) 10) (list "foo" "bar"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement