Skip to content

Comment on Making Map Operations Implicit in Programming

Comments

My favourite example of a language with 'automatic functorization' is Icon/Unicon. All functions, when applied to generators, themselves become generators.

So e.g. `read` is a generator that reads lines from the input, `write` writes a line to output, and the composition of them, `write(read())`, is a generator that copies lines from input to output. To run the generator, you can write `while write(read())`.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.