Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement
map
in the more obvious way
The most obvious way to do it is frankly a little bit faster. I originally planned to use concat with left-fold because I wanted to rely on tail call optimization, but I didn't realize how that wouldn't work in that case. This way still requires the stack, unfortunately. I'm trying to think of whether there might be a way to implement some kind of tail optimization with cons specifically so that list generating functions don't overflow the stack, but I'm not quite sure how to make that happen yet.
- Loading branch information