{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE Safe #-}
module Text.Megaparsec.Common
( string,
string',
)
where
import qualified Data.CaseInsensitive as CI
import Data.Function (on)
import Text.Megaparsec
string :: MonadParsec e s m => Tokens s -> m (Tokens s)
string :: Tokens s -> m (Tokens s)
string = Tokens s -> m (Tokens s)
forall e s (m :: * -> *).
MonadParsec e s m =>
Tokens s -> m (Tokens s)
chunk
{-# INLINE string #-}
string' ::
(MonadParsec e s m, CI.FoldCase (Tokens s)) =>
Tokens s ->
m (Tokens s)
string' :: Tokens s -> m (Tokens s)
string' = (Tokens s -> Tokens s -> Bool) -> Tokens s -> m (Tokens s)
forall e s (m :: * -> *).
MonadParsec e s m =>
(Tokens s -> Tokens s -> Bool) -> Tokens s -> m (Tokens s)
tokens (CI (Tokens s) -> CI (Tokens s) -> Bool
forall a. Eq a => a -> a -> Bool
(==) (CI (Tokens s) -> CI (Tokens s) -> Bool)
-> (Tokens s -> CI (Tokens s)) -> Tokens s -> Tokens s -> Bool
forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
`on` Tokens s -> CI (Tokens s)
forall s. FoldCase s => s -> CI s
CI.mk)
{-# INLINE string' #-}