Skip to content

Instantly share code, notes, and snippets.

@samth
Created August 24, 2012 11:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samth/3449728 to your computer and use it in GitHub Desktop.
Save samth/3449728 to your computer and use it in GitHub Desktop.
Why any-wrap/c is needed
#lang racket/load
(module m1 typed/racket
(: f : Integer -> Integer)
(define (f x) (add1 x))
(define: g : Any f) ;; safe by subtyping
(provide g))
(module m2 racket
(require 'm1)
(g "not a number")) ;; fails at runtime
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment