Skip to content

Commit

Permalink
Add Num constraint for base-4.6 compatibility
Browse files Browse the repository at this point in the history
Starting with `base-4.6` the `Bits` class does not have
a `Num` superclass anymore.
  • Loading branch information
hvr committed Sep 12, 2012
1 parent 9b27414 commit 8033618
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Snap/Internal/Parsing.hs
Expand Up @@ -465,7 +465,7 @@ strictize :: L.ByteString -> ByteString
strictize = S.concat . L.toChunks

------------------------------------------------------------------------------
unsafeFromHex :: (Enum a, Bits a) => ByteString -> a
unsafeFromHex :: (Enum a, Num a, Bits a) => ByteString -> a
unsafeFromHex = S.foldl' f 0
where
#if MIN_VERSION_base(4,5,0)
Expand All @@ -484,7 +484,7 @@ unsafeFromHex = S.foldl' f 0


------------------------------------------------------------------------------
unsafeFromInt :: (Enum a, Bits a) => ByteString -> a
unsafeFromInt :: (Enum a, Num a, Bits a) => ByteString -> a
unsafeFromInt = S.foldl' f 0
where
f !cnt !i = cnt * 10 + toEnum (digitToInt i)
Expand Down

0 comments on commit 8033618

Please sign in to comment.