Skip to content

Instantly share code, notes, and snippets.

@philnguyen
Created June 25, 2013 04:19
Show Gist options
  • Save philnguyen/5855906 to your computer and use it in GitHub Desktop.
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
#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