
4 Dec
2009
4 Dec
'09
8:26 p.m.
Hi, I'm a bit stuck. I want to indent my answer by using a count function to indent my answer. Say for example I want to show the levels in a simple arithmethic expression. like 3*(4+5) I want to be able to print out : 4+5 = 9 3*9 = 27 (notice the indentation as I go through an expression. I tried this but it a mess, I tried to use prettyprint but this seemed very complicated. Any suggestions greatly appreciated type Indent = (Int) spacing :: Int -> Indent spacing n = Nothing spacing n (x:xs) = if (n==1) then (Just n) else spacing n xs where (n > 1) John