30 Mar 2020
Fritz Ruehr’s rhyme gives us the essence of parsers:
A Parser for Things is a function from Strings to Lists of Pairs of Things and Strings!
This rhyme was made popular, I believe, in Programming in Haskell book by Graham Hutton.
Once you read Vaibhav Sagar’s post, followed by the HN discussion, you’ll notice two new rhymes coming out: the rhyme of the altered parser, and the rhyme of the yoctoparsec.
The rhyme of the altered Parser:
A parser for things is a function from strings to potentially a pair of that thing and its string.
The rhyme of the yoctoparsec:
A parser just means A function from streams To maybe a pair, One in which there Is the stream, and the thing that it means.