Commit 58972131 authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel 🕺

Remove redundant `#if`s

`#if __GLASGOW_HASKELL__ > xxx` macros make little sense inside `base`
currently.

Reviewed By: austin

Differential Revision: https://phabricator.haskell.org/D1541
parent 616aceba
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE DeriveFunctor #-}
......@@ -77,9 +76,7 @@ import GHC.Unicode ( isSpace )
import GHC.List ( replicate, null )
import GHC.Base hiding ( many )
#if __GLASGOW_HASKELL__ > 710
import Control.Monad.Fail
#endif
infixr 5 +++, <++
......@@ -124,10 +121,8 @@ instance Monad P where
fail _ = Fail
#if __GLASGOW_HASKELL__ > 710
instance MonadFail P where
fail _ = Fail
#endif
instance Alternative P where
empty = Fail
......@@ -176,10 +171,8 @@ instance Monad ReadP where
fail _ = R (\_ -> Fail)
R m >>= f = R (\k -> m (\a -> let R m' = f a in m' k))
#if __GLASGOW_HASKELL__ > 710
instance MonadFail ReadP where
fail _ = R (\_ -> Fail)
#endif
instance Alternative ReadP where
empty = mzero
......
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
-- |
......@@ -65,9 +64,7 @@ import qualified Text.ParserCombinators.ReadP as ReadP
import GHC.Num( Num(..) )
import GHC.Base
#if __GLASGOW_HASKELL__ > 710
import qualified Control.Monad.Fail as MonadFail
#endif
-- ---------------------------------------------------------------------------
-- The readPrec type
......@@ -87,10 +84,8 @@ instance Monad ReadPrec where
fail s = P (\_ -> fail s)
P f >>= k = P (\n -> do a <- f n; let P f' = k a in f' n)
#if __GLASGOW_HASKELL__ > 710
instance MonadFail.MonadFail ReadPrec where
fail s = P (\_ -> fail s)
#endif
instance MonadPlus ReadPrec where
mzero = pfail
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment