Hi Bas, I had a requirement to do something similar as part of one of my projects, essentially reduce full Haskell to a small and manageable subset. Unfortunately I think you'll find that this task is a lot bigger than you first realise, and in particular that case-of is probably the expression you want to reduce everything to - rather than if-then-else. case-of can represent pattern matches in a much more uniform way than if-then-else, which is just a case-of on a boolean.
The way I went about this was by using Yhc -core [1] to generate a Core language. GHC also has a Core language, which has various differences to the Yhc generated Core, and may be more to your liking (or perhaps less). I would suggest you explore these avenues before trying to write your own simplifier. Thanks Neil [1] http://www.haskell.org/haskellwiki/Yhc/API/Core _______________________________________________ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell