
22 Mar
2009
22 Mar
'09
10:11 a.m.
Anonymous Anonymous
fromIntToString :: Int -> String
...
PS: if possible please do not use any casting functions that are predefined.
This is a rather simplified version of the Show instance of Int from the libs: itos :: Int -> String itos x | x < 0 = '-' : itos (negate x) | x < 10 = "0123456789" !! x : "" | otherwise = let (q, r) = x `quotRem` 10 in itos q ++ itos r -- Gökhan San