summaryrefslogtreecommitdiff
path: root/src/Data/Bytes/Get.hs
diff options
context:
space:
mode:
authorryanglscott <>2019-08-27 15:41:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2019-08-27 15:41:00 (GMT)
commit88e2673ab9e2131fd10e305a958a14adc6cd13f5 (patch)
treee22b7ee009012d359980c970374a597692239b58 /src/Data/Bytes/Get.hs
parent8df84b33b593440c92ce10700bd6b34ff20b4596 (diff)
version 0.16HEAD0.16master
Diffstat (limited to 'src/Data/Bytes/Get.hs')
-rw-r--r--src/Data/Bytes/Get.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Data/Bytes/Get.hs b/src/Data/Bytes/Get.hs
index 6ab1a04..b4e1be2 100644
--- a/src/Data/Bytes/Get.hs
+++ b/src/Data/Bytes/Get.hs
@@ -43,7 +43,11 @@ import Data.Int
import qualified Data.Serialize.Get as S
import Data.Word
-class (Integral (Remaining m), Monad m, Applicative m) => MonadGet m where
+import Control.Monad.Trans.Instances ()
+import Data.Binary.Orphans ()
+import qualified Control.Monad.Fail as Fail
+
+class (Integral (Remaining m), Fail.MonadFail m, Applicative m) => MonadGet m where
-- | An 'Integral' number type used for unchecked skips and counting.
type Remaining m :: *
@@ -211,7 +215,7 @@ instance MonadGet B.Get where
{-# INLINE lookAheadE #-}
ensure n = do
bs <- lookAhead $ getByteString n
- unless (Strict.length bs >= n) $ fail "ensure: Required more bytes"
+ unless (Strict.length bs >= n) $ Fail.fail "ensure: Required more bytes"
return bs
{-# INLINE ensure #-}
getBytes = B.getByteString