Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add `Num` constraint for `base-4.6` compatibility

Starting with `base-4.6` the `Bits` class does not have
a `Num` superclass anymore.
  • Loading branch information...
commit 8033618842bfa9398043785e84769bfb5066f6cb 1 parent 9b27414
@hvr hvr authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/Snap/Internal/Parsing.hs
View
4 src/Snap/Internal/Parsing.hs
@@ -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)
@@ -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)
Please sign in to comment.
Something went wrong with that request. Please try again.