I have googled about trying to find a simple example of Haskell being used to define a simple language but to no avail.
I did find this post on stackoverflow giving a similar example, but when i implemented it, it didn't appear to work:
Haskell - How to best to represent a programming language's grammar?
an example expression in this language would be:
if true then x else (if false then y else true) Your Haskell data type would look something like this:
data Expr = Var String
| Lit Bool
| If Expr Expr Expr
however, when i entered if true then x else (if false then y else true) into the console as input, it complained about "x" not being interpretable. It also didn't like true and false.
EDIT: I did derive "show" also, at the end