mirror of
https://github.com/mrkkrp/megaparsec.git
synced 2024-12-25 09:12:29 +03:00
Add #if for bool :: a -> a -> Bool -> a.
This commit is contained in:
parent
64053a60bd
commit
65aa745a58
@ -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:
|
||||
|
@ -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@.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user