
18 Nov
2012
18 Nov
'12
5:45 p.m.
Jonas Almström Duregård
Hi,
You can make a datatype that captures exactly the expressions you want (see code below). Essentially you want to make sure that a subtraction or addition never has another subtraction or addition as its left operand.
I would also like to advertise a bit and show how this type can be enumerated automatically by Feat ( http://hackage.haskell.org/package/testing-feat).
After a quick look, Feat seems to be awesome. Thanks! I don’t yet know how I am going to use it, but I hope an opportunity will present itself soon :)