Skip to content
Snippets Groups Projects
Unverified Commit 94855814 authored by Lennart Kolmodin's avatar Lennart Kolmodin Committed by GitHub
Browse files

Merge pull request #161 from hvr/pr/base413

Compatibility with future ghc-8.8/base-4.13
parents 775b4561 0f752eca
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment