PasteRack.org
Paste # 23383
2014-10-23 21:23:00

Fork as a new paste.

Paste viewed 104 times.


Embed:

  1. #lang typed/racket
  2.  
  3. (define-struct Point
  4.   ([x : Real]
  5.    [y : Real]))
  6.  
  7. (define-struct Rectangle
  8.   ([bot-left : Point]
  9.    [top-right : Point]))
  10.  
  11. (define-struct Circle
  12.   ([radius : Real]
  13.    [center : Point]))
  14.  
  15. (define xs (map (lambda ([c : Circle]) (Point-x (Circle-center c))) circles))
  16.  
  17.  
  18.  
  19. Type Checker: type mismatch
  20.   expected: Real
  21.   given: (Listof Real) in: (map (lambda ((x : Real) (y : Real)) (- x y)) xs radii)
  22.  

=>