...
 
Commits (2)
......@@ -974,7 +974,7 @@ putTypeRep (Fun arg res) = do
put (3 :: Word8)
putTypeRep arg
putTypeRep res
putTypeRep _ = fail "GHCi.TH.Binary.putTypeRep: Impossible"
putTypeRep _ = error "GHCi.TH.Binary.putTypeRep: Impossible"
getSomeTypeRep :: Get SomeTypeRep
getSomeTypeRep = do
......
......@@ -91,12 +91,20 @@ type Success a r = B.ByteString -> a -> Decoder r
instance Monad Get where
return = pure
(>>=) = bindG
#if MIN_VERSION_base(4,9,0)
fail = Fail.fail
#if !(MIN_VERSION_base(4,9,0))
fail = failG -- base < 4.9
#elif !(MIN_VERSION_base(4,13,0))
fail = Fail.fail -- base < 4.13
#endif
-- NB: Starting with base-4.13, the `fail` method
-- has been removed from the `Monad`-class
-- according to the MonadFail proposal (MFP) schedule
-- which completes the process that started with base-4.9.
#if MIN_VERSION_base(4,9,0)
instance Fail.MonadFail Get where
#endif
fail = failG
#endif
bindG :: Get a -> (a -> Get b) -> Get b
bindG (C c) f = C $ \i ks -> c i (\i' a -> (runCont (f a)) i' ks)
......