foo = (n) -> (-> i) for i in [0..n]
Here's one way:
foo = (n) -> ((a) -> a).bind(null, i) for i in [0...n]
foo = (n) -> (-> +@).bind i for i in [0...n]