Skip to content

Commit 02562af

Browse files
committed
Relax constraints on decimal, hexadecimal, hex from Integral to Num
1 parent 2ef973b commit 02562af

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/Data/Text/Read.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ type Parser a = IParser Text a
4747
-- attempt to detect overflow, so a sufficiently long input may give
4848
-- incorrect results. If you are worried about overflow, use
4949
-- 'Integer' for your result type.
50-
decimal :: Integral a => Reader a
50+
decimal :: Num a => Reader a
5151
{-# SPECIALIZE decimal :: Reader Int #-}
5252
{-# SPECIALIZE decimal :: Reader Int8 #-}
5353
{-# SPECIALIZE decimal :: Reader Int16 #-}
@@ -77,7 +77,7 @@ decimal txt
7777
-- attempt to detect overflow, so a sufficiently long input may give
7878
-- incorrect results. If you are worried about overflow, use
7979
-- 'Integer' for your result type.
80-
hexadecimal :: Integral a => Reader a
80+
hexadecimal :: Num a => Reader a
8181
{-# SPECIALIZE hexadecimal :: Reader Int #-}
8282
{-# SPECIALIZE hexadecimal :: Reader Int8 #-}
8383
{-# SPECIALIZE hexadecimal :: Reader Int16 #-}
@@ -94,7 +94,7 @@ hexadecimal txt
9494
| otherwise = hex txt
9595
where (h,t) = T.splitAt 2 txt
9696

97-
hex :: Integral a => Reader a
97+
hex :: Num a => Reader a
9898
{-# SPECIALIZE hex :: Reader Int #-}
9999
{-# SPECIALIZE hex :: Reader Int8 #-}
100100
{-# SPECIALIZE hex :: Reader Int16 #-}

0 commit comments

Comments
 (0)