Advertisement
Guest User

Untitled

a guest
Apr 1st, 2019
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. (provide
  2. (contract-out
  3. #:forall A
  4. #:forall B
  5. [map (-> (-> A B) (listof A) (listof B))]))
  6. (define (map f l)
  7. (match l
  8. [(list) empty]
  9. [(list h t ...) (cons h (map f t))])) ; <- Error should break internal contract by simply cons-ing h.
  10.  
  11.  
  12. (map (lambda (x) 10) (list "foo" "bar"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement