@@ -38,7 +38,7 @@ decimal :: Integral a => Reader a
3838{-# SPECIALIZE decimal :: Reader Int #-}
3939{-# SPECIALIZE decimal :: Reader Integer #-}
4040decimal txt
41− | T.null h = Left "no digits in input"
41+ | T.null h = Left "input does not start with a digit"
4242 | otherwise = Right (T.foldl' go 0 h, t)
4343 where (h,t) = T.spanBy isDigit txt
4444 go n d = (n * 10 + fromIntegral (digitToInt d))
@@ -91,7 +91,7 @@ hex :: Integral a => Reader a
9191{-# SPECIALIZE hex :: Reader Int #-}
9292{-# SPECIALIZE hex :: Reader Integer #-}
9393hex txt
94− | T.null h = Left "no digits in input"
94+ | T.null h = Left "input does not start with a hexadecimal digit"
9595 | otherwise = Right (T.foldl' go 0 h, t)
9696 where (h,t) = T.spanBy isHexDigit txt
9797 go n d = (n * 16 + fromIntegral (hexDigitToInt d))
@@ -131,7 +131,7 @@ perhaps def m = P $ \t -> case runP m t of
131131char :: (Char -> Bool) -> Parser Char
132132char p = P $ \t -> case T.uncons t of
133133 Just (c,t') | p c -> Right (c,t')
134− _ -> Left "char"
134+ _ -> Left "character does not match"
135135
136136data T = T !Integer !Int
137137