Find file
Fetching contributors…
Cannot retrieve contributors at this time
9 lines (6 sloc) 211 Bytes
import Data.Char (digitToInt)
asInt :: String -> Int
asInt xs = loop 0 xs
where loop acc (x:xs) = let acc' = acc * 10 + digitToInt x
in loop acc' xs
loop acc [] = acc