The Pragmatic Haskeller, Episode 5 – Let’s Write a DSL! by Alfredo Di Napoli.
From the post:
Good morning everyone,
after a small break let’s resume our journey into the pragmatic world of the “Pragmatic Haskeller” series, this time exploring Parsec, a combinators library which will allow us to write a domain specific language to describe recipes.
We’ll see how Haskell type safety makes the process a breeze, and as a nice side effect (pun intended), our parser will be less than 100 SLOC! What are you waiting for? The code and the full disclosure is hosted once again on “The School of Haskell”, so that I can provide the reader with interactive examples:
https://www.fpcomplete.com/user/adinapoli/the-pragmatic-haskeller/episode-5-a-simple-dsl
Very cool!
Alfredo challenges you to find a bug in the data structure.
My challenge would be how do we reconcile DSLs with the same subjects but different tokens to represent them?