Created
June 25, 2013 04:19
-
-
Save philnguyen/5855906 to your computer and use it in GitHub Desktop.
To illustrate how this clever Python solution here can be typed in Typed Racket http://stackoverflow.com/a/732049/159759
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang typed/racket | |
(: f (case-> | |
[Number -> (-> Number)] | |
[(-> Number) -> Number])) | |
(define (f x) | |
(if (number? x) (λ () (- x)) (x))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment