trifecta-1.6.2.1: A modern parser combinator library with convenient diagnostics

Copyright(C) 2011-2015 Edward Kmett
LicenseBSD-style (see the file LICENSE)
MaintainerEdward Kmett <ekmett@gmail.com>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellSafe
LanguageHaskell2010

Text.Trifecta.Delta

Description

 

Synopsis

Documentation

data Delta #

Instances

Eq Delta # 

Methods

(==) :: Delta -> Delta -> Bool #

(/=) :: Delta -> Delta -> Bool #

Data Delta # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Delta -> c Delta #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Delta #

toConstr :: Delta -> Constr #

dataTypeOf :: Delta -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c Delta) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Delta) #

gmapT :: (forall b. Data b => b -> b) -> Delta -> Delta #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Delta -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Delta -> r #

gmapQ :: (forall d. Data d => d -> u) -> Delta -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Delta -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Delta -> m Delta #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Delta -> m Delta #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Delta -> m Delta #

Ord Delta # 

Methods

compare :: Delta -> Delta -> Ordering #

(<) :: Delta -> Delta -> Bool #

(<=) :: Delta -> Delta -> Bool #

(>) :: Delta -> Delta -> Bool #

(>=) :: Delta -> Delta -> Bool #

max :: Delta -> Delta -> Delta #

min :: Delta -> Delta -> Delta #

Show Delta # 

Methods

showsPrec :: Int -> Delta -> ShowS #

show :: Delta -> String #

showList :: [Delta] -> ShowS #

Generic Delta # 

Associated Types

type Rep Delta :: * -> * #

Methods

from :: Delta -> Rep Delta x #

to :: Rep Delta x -> Delta #

Semigroup Delta # 

Methods

(<>) :: Delta -> Delta -> Delta #

sconcat :: NonEmpty Delta -> Delta #

stimes :: Integral b => b -> Delta -> Delta #

Monoid Delta # 

Methods

mempty :: Delta #

mappend :: Delta -> Delta -> Delta #

mconcat :: [Delta] -> Delta #

Pretty Delta # 

Methods

pretty :: Delta -> Doc #

prettyList :: [Delta] -> Doc #

Hashable Delta # 

Methods

hashWithSalt :: Int -> Delta -> Int #

hash :: Delta -> Int #

HasDelta Delta # 

Methods

delta :: Delta -> Delta #

HasBytes Delta # 

Methods

bytes :: Delta -> Int64 #

Measured Delta Rope # 

Methods

measure :: Rope -> Delta #

Measured Delta Strand # 

Methods

measure :: Strand -> Delta #

MarkParsing Delta Parser # 

Methods

mark :: Parser Delta #

release :: Delta -> Parser () #

type Rep Delta # 
type Rep Delta = D1 (MetaData "Delta" "Text.Trifecta.Delta" "trifecta-1.6.2.1-86vMugSXw24KuYSACyjtxG" False) ((:+:) ((:+:) (C1 (MetaCons "Columns" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) SourceUnpack SourceStrict DecidedUnpack) (Rec0 Int64)) (S1 (MetaSel (Nothing Symbol) SourceUnpack SourceStrict DecidedUnpack) (Rec0 Int64)))) (C1 (MetaCons "Tab" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) SourceUnpack SourceStrict DecidedUnpack) (Rec0 Int64)) ((:*:) (S1 (MetaSel (Nothing Symbol) SourceUnpack SourceStrict DecidedUnpack) (Rec0 Int64)) (S1 (MetaSel (Nothing Symbol) SourceUnpack SourceStrict DecidedUnpack) (Rec0 Int64)))))) ((:+:) (C1 (MetaCons "Lines" PrefixI False) ((:*:) ((:*:) (S1 (MetaSel (Nothing Symbol) SourceUnpack SourceStrict DecidedUnpack) (Rec0 Int64)) (S1 (MetaSel (Nothing Symbol) SourceUnpack SourceStrict DecidedUnpack) (Rec0 Int64))) ((:*:) (S1 (MetaSel (Nothing Symbol) SourceUnpack SourceStrict DecidedUnpack) (Rec0 Int64)) (S1 (MetaSel (Nothing Symbol) SourceUnpack SourceStrict DecidedUnpack) (Rec0 Int64))))) (C1 (MetaCons "Directed" PrefixI False) ((:*:) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 ByteString)) (S1 (MetaSel (Nothing Symbol) SourceUnpack SourceStrict DecidedUnpack) (Rec0 Int64))) ((:*:) (S1 (MetaSel (Nothing Symbol) SourceUnpack SourceStrict DecidedUnpack) (Rec0 Int64)) ((:*:) (S1 (MetaSel (Nothing Symbol) SourceUnpack SourceStrict DecidedUnpack) (Rec0 Int64)) (S1 (MetaSel (Nothing Symbol) SourceUnpack SourceStrict DecidedUnpack) (Rec0 Int64))))))))

class HasDelta t where #

Minimal complete definition

delta

Methods

delta :: t -> Delta #

Instances

HasDelta Char # 

Methods

delta :: Char -> Delta #

HasDelta Word8 # 

Methods

delta :: Word8 -> Delta #

HasDelta ByteString # 

Methods

delta :: ByteString -> Delta #

HasDelta Delta # 

Methods

delta :: Delta -> Delta #

HasDelta Rope # 

Methods

delta :: Rope -> Delta #

HasDelta Strand # 

Methods

delta :: Strand -> Delta #

HasDelta HighlightedRope # 
HasDelta Rendering # 

Methods

delta :: Rendering -> Delta #

HasDelta Caret # 

Methods

delta :: Caret -> Delta #

HasDelta (Careted a) # 

Methods

delta :: Careted a -> Delta #

HasDelta (Rendered a) # 

Methods

delta :: Rendered a -> Delta #

(HasDelta l, HasDelta r) => HasDelta (Either l r) # 

Methods

delta :: Either l r -> Delta #

(Measured v a, HasDelta v) => HasDelta (FingerTree v a) # 

Methods

delta :: FingerTree v a -> Delta #

class HasBytes t where #

Minimal complete definition

bytes

Methods

bytes :: t -> Int64 #

Instances

HasBytes ByteString # 

Methods

bytes :: ByteString -> Int64 #

HasBytes Delta # 

Methods

bytes :: Delta -> Int64 #

HasBytes Rope # 

Methods

bytes :: Rope -> Int64 #

HasBytes Strand # 

Methods

bytes :: Strand -> Int64 #

HasBytes HighlightedRope # 
HasBytes Caret # 

Methods

bytes :: Caret -> Int64 #

HasBytes (Careted a) # 

Methods

bytes :: Careted a -> Int64 #

HasBytes (Rendered a) # 

Methods

bytes :: Rendered a -> Int64 #

(Measured v a, HasBytes v) => HasBytes (FingerTree v a) # 

Methods

bytes :: FingerTree v a -> Int64 #

nextTab :: Int64 -> Int64 #

Increment a column number to the next tabstop.

rewind :: Delta -> Delta #

Rewind a Delta to the beginning of the line.

near :: (HasDelta s, HasDelta t) => s -> t -> Bool #

Should we show two things with a Delta on the same line?

column :: HasDelta t => t -> Int64 #

Retrieve the character offset within the current line from this Delta.

columnByte :: Delta -> Int64 #

Retrieve the byte offset within the current line from this Delta.