tabToSpace tabSize s = tabToSpace' tabSize s where tabToSpace' _ "" = "" tabToSpace' 0 s = tabToSpace' tabSize s tabToSpace' i ('\t':cs) = (take i $ repeat ' ') ++ (tabToSpace' tabSize cs) tabToSpace' i (c:cs) = c:(tabToSpace' (i-1) cs)
tabToSpace tabSize s = tabToSpace' tabSize s where tabToSpace' _ "" = "" tabToSpace' 0 s = tabToSpace' tabSize s tabToSpace' i ('\t':cs) = (take i $ repeat ' ') ++ (tabToSpace' tabSize cs) tabToSpace' i (c:cs) = c:(tabToSpace' (i-1) cs)