p package:simple-reflect

Simple reflection of expressions containing variables This package allows simple reflection of expressions containing variables. Reflection here means that a Haskell expression is turned into a string. The primary aim of this package is teaching and understanding; there are no options for manipulating the reflected expressions beyond showing them.
Simple reflection of haskell expressions containing variables. Some examples:
> sum [1..5] :: Expr
0 + 1 + 2 + 3 + 4 + 5
> foldr1 f [a,b,c]
f a (f b c)
> take 5 (iterate f x)
[x,f x,f (f x),f (f (f x)),f (f (f (f x)))]
> mapM_ print $ reduction (1+2*(3+4))
1 + 2 * (3 + 4)
1 + 2 * 7
1 + 14
15
Simple reflection of haskell expressions containing variables.
A reflected expression
Conversion from Expr to other types
Force something to be an expression.
An infix operator with the given associativity, precedence and name