
4 Mar
2011
4 Mar
'11
6:09 p.m.
On 4 March 2011 22:10, Job Vranish
Make your own expression type and make it an instance of the Num typeclass.
This is also the approach I took in repr: http://hackage.haskell.org/package/repr For example: $ cabal install repr $ ghci
import Text.Repr let r = 1.5 + 2 + (3 + (-4) * (5 - pi / sqrt 6)) :: Repr Double extract r 17.281195923884734 show r "fromRational (3 % 2) + 2 + (3 + negate 4 * (5 - pi / sqrt 6))"
Bas