From b16f2cf2c64044e8dab473f9c49231b9bcdeb82f Mon Sep 17 00:00:00 2001 From: Brian Huffman Date: Tue, 5 May 2020 12:43:16 -0700 Subject: [PATCH] Change type of function `numToken` to avoid use of `fromInteger`. --- src/Cryptol/Parser/LexerUtils.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Cryptol/Parser/LexerUtils.hs b/src/Cryptol/Parser/LexerUtils.hs index 9781accd..a5030ad6 100644 --- a/src/Cryptol/Parser/LexerUtils.hs +++ b/src/Cryptol/Parser/LexerUtils.hs @@ -213,11 +213,11 @@ splitQual t = -------------------------------------------------------------------------------- -numToken :: Integer -> Text -> TokenT -numToken rad ds = Num (toVal ds') (fromInteger rad) (T.length ds') +numToken :: Int {- ^ base -} -> Text -> TokenT +numToken rad ds = Num (toVal ds') rad (T.length ds') where ds' = T.filter (/= '_') ds - toVal = T.foldl' (\x c -> rad * x + fromDigit c) 0 + toVal = T.foldl' (\x c -> toInteger rad * x + fromDigit c) 0 fromDigit :: Char -> Integer fromDigit x'