4 ms·
Also, the introduction of a 'Sed' monad was a lightbulb moment for me during this project: https://github.com/tomfitzhenry/hs-sed/commit/0eb7797439e54ab69a31a04
by tomfitz 13y ago
Also, the introduction of a 'Sed' monad was a lightbulb moment for me during this project: https://github.com/tomfitzhenry/hs-sed/commit/0eb7797439e54ab69a31a041f68aefbca22f1ced https://github.com/tomfitzhenry/hs-sed/commit/0eb7797439e54a...
In particular, the changes in Execute.hs are where using a monad made this code more clear.
If you're new to the usefulness of monads, I don't suggest you read this code, however, and that instead you read:
1. "You Could Have Invented Monads!" http://blog.sigfpe.com/2006/08/you-could-have-invented-monads-and.html http://blog.sigfpe.com/2006/08/you-could-have-invented-monad...
2. "Monad Transformers Step by Step" http://www.cs.virginia.edu/~wh5a/personal/Transformers.pdf http://www.cs.virginia.edu/~wh5a/personal/Transformers.pdf