Add #if for bool :: a -> a -> Bool -> a.

This commit is contained in:
Benjamin Kaestner 2015-10-03 16:52:20 +02:00
parent 64053a60bd
commit 65aa745a58
2 changed files with 14 additions and 0 deletions

View File

@ -28,7 +28,9 @@ module Text.Megaparsec.Error
, showMessages )
where
#if MIN_VERSION_base(4,7,0)
import Data.Bool (bool)
#endif
import Data.List (intercalate)
import Data.Maybe (fromMaybe)
@ -38,6 +40,11 @@ import Text.Megaparsec.Pos
import Control.Applicative ((<$>))
import Data.Foldable (foldMap)
#endif
#if !MIN_VERSION_base(4,7,0)
bool :: a -> a -> Bool -> a
bool f _ False = f
bool _ t True = t
#endif
-- | This data type represents parse error messages. There are three kinds
-- of messages:

View File

@ -40,7 +40,9 @@ module Text.Megaparsec.Prim
, parseTest )
where
#if MIN_VERSION_base(4,7,0)
import Data.Bool (bool)
#endif
import Data.Monoid
import Control.Monad
@ -70,6 +72,11 @@ import Text.Megaparsec.ShowToken
#if !MIN_VERSION_base(4,8,0)
import Control.Applicative ((<$>), (<*))
#endif
#if !MIN_VERSION_base(4,7,0)
bool :: a -> a -> Bool -> a
bool f _ False = f
bool _ t True = t
#endif
-- | This is Megaparsec state, it's parametrized over stream type @s@.