packages feed

tilia-0.2.0.0: corpora/vendored/cpp/expression/case-head-past-the-column-limit-after-an-arrow-out.hs

{-# LANGUAGE CPP #-}

module Parse.Decimal (decimal) where

decimal :: Int -> String -> Int
decimal acc input = case input of
  [] -> acc
  w : rest -> case w of
#if MIN_VERSION_base(4,16,0)
    c
      | isDigitCharacter c,
        notTooLarge acc -> case multiplyTheAccumulatorByTenSafely
          acc
          (digitValueOf c) of
          Just next -> decimal next rest
#else
    c
      | isDigit c,
        notTooLarge acc -> case multiplyByTen acc (digitToInt c) of
          Just next -> decimal next rest
#endif
          Nothing -> acc