Skip to content

Instantly share code, notes, and snippets.

@dyoo
Created February 27, 2013 00:50
Show Gist options
  • Select an option

  • Save dyoo/5043863 to your computer and use it in GitHub Desktop.

Select an option

Save dyoo/5043863 to your computer and use it in GitHub Desktop.
#lang typed/racket
(define-type pixel Integer)
(: create-bitmap : Integer Integer (Integer Integer -> pixel) -> (Vectorof (Vectorof pixel)))
(define (create-bitmap width height generator)
(for/vector: : (Vectorof (Vectorof pixel)) ((y : Integer (in-range height)))
(for/vector: : (Vectorof pixel) ((x : Integer (in-range width)))
(generator x y))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment