Close, but I checked it and the value of `i` won't bind to the function. You also have to use `...` (exclusive range) instead of `..` to prevent an off-by-one error.
Here's one way:
foo = (n) -> ((a) -> a).bind(null, i) for i in [0...n]
Here's a more esoteric/bad style (but cute) way: foo = (n) -> (-> +@).bind i for i in [0...n]