by codebje · 1mo ago · 0 comments
The question is capabilities. Either gives you an error result that might be useful. List gives you backtracking and, depending on your grammar, multiple parses. Maybe is like a weaker Either. Other monads might do other interesting things, but from the perspective of accepting strings satisfying a grammar, List is the choice that supports non-determinism.
(Laziness strongly recommended.)
The poem is not mine, I believe it is Conor McBride’s.
[1] https://myotherpants.com/tag/test-first/
[2] https://www.amazon.com/Programming-Haskell-Graham-Hutton/dp/...