, - - , . , , , ,
hexToInteger :: String -> Integer
hexToInteger string = hexToIntegerHelper initialAccumulator string
, reverse
reverse :: [a] -> [a]
reverse xs = reverseHelper [] xs
reverseHelper :: [a] -> [a] -> [a]
reverseHelper accumulator [] = accumulator
reverseHelper accumulator (x:xs) = reverseHelper (x:accumulator) xs
- (fudging )
factorial :: Integer -> Integer
factorial n = factorialHelper 1 n
factorialHelper :: Integer -> Integer -> Integer
factorialHelper accumulator n
| n < 2 = accumulator
| otherwise = factorialHelper (n*accumulator) (n-1)
, hexToIntegerHelper,
hexToIntegerHelper :: Integer -> String -> Integer
hexToIntegerHelper accumulator "" = accumulator
hexToIntegerHelper accumulator (d:ds) = hexToIntegerHelper (newAccumulatorFrom accumulator d) ds
, ( ).
digitToInt :: Char -> Int
Data.Char , . , fromIntegral toInteger Int Integer.