2 ms·
> forced to duplicate the monadic combinators (e.g: inlined replicateM here). ??? This is a bare bones for loop. What exactly do you consider "duplication" ???
by pacala 13y ago
> forced to duplicate the monadic combinators (e.g: inlined replicateM here).
??? This is a bare bones for loop. What exactly do you consider "duplication" ???
Regrettably, I can't accept the challenge because I have no idea what the code you pasted is doing and why.
- Peaker 13y agoA bare bones for loop is the implementation of replicateM. There are more complex combinators than replicateM, e.g: filterM, zipWithM, and more... Which you would need more than duplicating a bare bones loop at every occurence. The code I pasted above uses "do" notation to write a monadic parser. The parser parses the format started by a <date>:<time> and if those set a date larger than some point in the past, it parses the continuation of the text differently. Which part of the code are you having difficulty understanding?