parsnip-0: A fast, minimal parser
Safe HaskellNone
LanguageHaskell2010

Text.Parsnip.Internal.Mark

Synopsis

Documentation

newtype Mark s Source #

Constructors

Mark (Ptr Word8) 

Bundled Patterns

pattern Mk :: Addr# -> Mark s 

Instances

Instances details
KnownBase s => Bounded (Mark s) Source # 
Instance details

Defined in Text.Parsnip.Internal.Mark

Methods

minBound :: Mark s #

maxBound :: Mark s #

KnownBase s => Enum (Mark s) Source # 
Instance details

Defined in Text.Parsnip.Internal.Mark

Methods

succ :: Mark s -> Mark s #

pred :: Mark s -> Mark s #

toEnum :: Int -> Mark s #

fromEnum :: Mark s -> Int #

enumFrom :: Mark s -> [Mark s] #

enumFromThen :: Mark s -> Mark s -> [Mark s] #

enumFromTo :: Mark s -> Mark s -> [Mark s] #

enumFromThenTo :: Mark s -> Mark s -> Mark s -> [Mark s] #

Eq (Mark s) Source # 
Instance details

Defined in Text.Parsnip.Internal.Mark

Methods

(==) :: Mark s -> Mark s -> Bool #

(/=) :: Mark s -> Mark s -> Bool #

Ord (Mark s) Source # 
Instance details

Defined in Text.Parsnip.Internal.Mark

Methods

compare :: Mark s -> Mark s -> Ordering #

(<) :: Mark s -> Mark s -> Bool #

(<=) :: Mark s -> Mark s -> Bool #

(>) :: Mark s -> Mark s -> Bool #

(>=) :: Mark s -> Mark s -> Bool #

max :: Mark s -> Mark s -> Mark s #

min :: Mark s -> Mark s -> Mark s #

Show (Mark s) Source # 
Instance details

Defined in Text.Parsnip.Internal.Mark

Methods

showsPrec :: Int -> Mark s -> ShowS #

show :: Mark s -> String #

showList :: [Mark s] -> ShowS #

Ix (Mark s) Source # 
Instance details

Defined in Text.Parsnip.Internal.Mark

Methods

range :: (Mark s, Mark s) -> [Mark s] #

index :: (Mark s, Mark s) -> Mark s -> Int #

unsafeIndex :: (Mark s, Mark s) -> Mark s -> Int #

inRange :: (Mark s, Mark s) -> Mark s -> Bool #

rangeSize :: (Mark s, Mark s) -> Int #

unsafeRangeSize :: (Mark s, Mark s) -> Int #

minusMark :: Mark s -> Mark s -> Int Source #

mark :: Parser s (Mark s) Source #

Record the current position

release :: Mark s -> Parser s () Source #

Return to a previous location.

snip :: forall s. KnownBase s => Mark s -> Mark s -> ByteString Source #

To grab all the text covered by a given parser, consider using snipping and applying it to a combinator simply recognizes the content rather than returns it. snipping a ByteString is significantly cheaper than assembling one from smaller fragments.

snipping :: forall s a. KnownBase s => Parser s a -> Parser s ByteString Source #