-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Parser combinators with slicing and diagnostic support -- -- Parser combinators with slicing and diagnostic support @package trifecta @version 0.11 module Text.Trifecta.Bytes class HasBytes t bytes :: HasBytes t => t -> Int instance (Measured v a, HasBytes v) => HasBytes (FingerTree v a) instance HasBytes ByteString module Text.Trifecta.Path type FileName = InternedString data Path Path :: {-# UNPACK #-} !Id -> !IntSet -> !History -> !MaybeFileName -> {-# UNPACK #-} !Int -> [Int] -> Path data History Continue :: !Path -> {-# UNPACK #-} !Int -> History Complete :: History file :: String -> Path snocPath :: Path -> Int -> MaybeFileName -> Int -> [Int] -> Path path :: History -> MaybeFileName -> Int -> [Int] -> Path appendPath :: Path -> Int -> Path -> Path comparablePath :: Path -> Path -> Bool data MaybeFileName JustFileName :: !FileName -> MaybeFileName NothingFileName :: MaybeFileName maybeFileName :: r -> (FileName -> r) -> MaybeFileName -> r instance Eq (Description Path) instance Eq MaybeFileName instance Show MaybeFileName instance Show Path instance Eq History instance Show History instance Eq DHistory instance Hashable (Description Path) instance Uninternable Path instance Interned Path instance Hashable Path instance Hashable DHistory instance Semigroup Path instance Ord Path instance Eq Path module Text.Trifecta.Delta data Delta Columns :: {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> Delta Tab :: {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> Delta Lines :: {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> Delta Directed :: !Path -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> Delta class HasDelta t delta :: HasDelta t => t -> Delta nextTab :: Int -> Int rewind :: Delta -> Delta near :: (HasDelta s, HasDelta t) => s -> t -> Bool column :: HasDelta t => t -> Int instance Eq Delta instance Ord Delta instance Show Delta instance (Measured v a, HasDelta v) => HasDelta (FingerTree v a) instance HasDelta Path instance HasDelta ByteString instance HasDelta Word8 instance HasDelta Char instance HasDelta Delta instance Semigroup Delta instance Monoid Delta instance Hashable Delta instance HasBytes Delta instance PrettyTerm Delta instance Pretty Delta -- | Diagnostics rendering module Text.Trifecta.Render data Render Render :: !Delta -> {-# UNPACK #-} !Int -> (Lines -> Lines) -> (Delta -> Lines -> Lines) -> Render rDelta :: Render -> !Delta rLineLen :: Render -> {-# UNPACK #-} !Int rLine :: Render -> Lines -> Lines rDraw :: Render -> Delta -> Lines -> Lines class Renderable t render :: Renderable t => t -> Render class Source t source :: Source t => t -> (Int, Lines -> Lines) -- | create a drawing surface surface :: Source s => Delta -> s -> Render type Lines = Array (Int, Int) ([ScopedEffect], Char) draw :: [ScopedEffect] -> Int -> Int -> String -> Lines -> Lines ifNear :: Delta -> (Lines -> Lines) -> Delta -> Lines -> Lines (.#) :: (Delta -> Lines -> Lines) -> Render -> Render instance PrettyTerm Render instance Show Render instance Pretty Render instance Source ByteString instance Source String instance Renderable Render instance HasDelta Render instance Semigroup Render module Text.Trifecta.Rendered data Rendered a (:@) :: a -> Render -> Rendered a instance Renderable (Rendered a) instance Traversable1 Rendered instance Foldable1 Rendered instance Traversable Rendered instance Foldable Rendered instance Bind Rendered instance Apply Rendered instance Comonad Rendered instance Extend Rendered instance HasBytes (Rendered a) instance HasDelta (Rendered a) instance Functor Rendered module Text.Trifecta.Diagnostic data DiagnosticLevel Note :: DiagnosticLevel Warning :: DiagnosticLevel Error :: DiagnosticLevel Fatal :: DiagnosticLevel data Diagnostic l m Diagnostic :: !Render -> l -> m -> [Diagnostic l m] -> Diagnostic l m instance Eq DiagnosticLevel instance Ord DiagnosticLevel instance Show DiagnosticLevel instance Read DiagnosticLevel instance Bitraversable1 Diagnostic instance Bifoldable1 Diagnostic instance Bitraversable Diagnostic instance Bifoldable Diagnostic instance Traversable1 (Diagnostic l) instance Foldable1 (Diagnostic l) instance Traversable (Diagnostic l) instance Foldable (Diagnostic l) instance Bifunctor Diagnostic instance Functor (Diagnostic l) instance (Pretty l, Pretty m) => Show (Diagnostic l m) instance (PrettyTerm l, PrettyTerm m) => PrettyTerm (Diagnostic l m) instance (Pretty l, Pretty m) => Pretty (Diagnostic l m) instance Comonad (Diagnostic l) instance Extend (Diagnostic l) instance HasBytes (Diagnostic l m) instance HasDelta (Diagnostic l m) instance Renderable (Diagnostic l m) instance PrettyTerm DiagnosticLevel instance Pretty DiagnosticLevel instance Semigroup DiagnosticLevel module Text.Trifecta.Hunk data Hunk Hunk :: {-# UNPACK #-} !Id -> !Delta -> {-# UNPACK #-} !ByteString -> Hunk hunk :: ByteString -> Hunk instance Eq (Description Hunk) instance Show Hunk instance Measured Delta Hunk instance Hashable (Description Hunk) instance Uninternable Hunk instance Interned Hunk instance HasDelta Hunk instance Ord Hunk instance Hashable Hunk instance Eq Hunk instance IsString Hunk module Text.Trifecta.Strand data Strand HunkStrand :: !Hunk -> Strand PathStrand :: !Path -> Strand instance Show Strand instance HasBytes Strand instance HasDelta Strand instance Hashable Strand instance Measured Delta Strand module Text.Trifecta.Rope data Rope Rope :: !Delta -> !FingerTree Delta Strand -> Rope rope :: FingerTree Delta Strand -> Rope strands :: Rope -> FingerTree Delta Strand -- | grab a lazy bytestring starting from some point. This bytestring does -- not cross path nodes if the index is to the start of a bytestring -- fragment, we update it to deal with any intervening path fragments grab :: Delta -> Rope -> (Delta -> ByteString -> r) -> r -> r -- | obtain the byte location of the last newline in a rope, or the end of -- the rope if at EOF lastNewline :: Rope -> Bool -> Delta instance Show Rope instance Reducer ByteString Rope instance Reducer Path Rope instance Reducer Hunk Rope instance Reducer Strand Rope instance Reducer Rope Rope instance Semigroup Rope instance Monoid Rope instance Measured Delta Rope instance HasDelta Rope instance HasBytes Rope module Text.Trifecta.It type P u = ParsecT Delta u It data It a Done :: !Rope -> !Bool -> a -> It a Fail :: !Rope -> !Bool -> String -> It a Cont :: (Rope -> Bool -> It a) -> It a input :: It Rope line :: Delta -> P u ByteString peekIt :: Delta -> It (Delta, ByteString) instance Stream Delta It Char instance MonadPlus It instance Monad It instance Bind It instance Alternative It instance Alt It instance Applicative It instance Apply It instance Functor It instance Show a => Show (It a) module Text.Trifecta.Caret -- |
-- In file included from baz.c:9
-- In file included from bar.c:4
-- foo.c:8:36: note
-- int main(int argc, char ** argv) { int; }
-- ^
--
data Caret
Caret :: !Delta -> {-# UNPACK #-} !ByteString -> Caret
class HasCaret t
caret :: HasCaret t => t -> Caret
data Careted a
(:^) :: a -> Caret -> Careted a
careted :: P u a -> P u (Careted a)
drawCaret :: Delta -> Delta -> Lines -> Lines
addCaret :: Delta -> Render -> Render
caretEffects :: [ScopedEffect]
instance Eq Caret
instance Ord Caret
instance Show Caret
instance Eq a => Eq (Careted a)
instance Ord a => Ord (Careted a)
instance Show a => Show (Careted a)
instance Hashable a => Hashable (Careted a)
instance HasCaret (Careted a)
instance Renderable (Careted a)
instance Traversable1 Careted
instance Foldable1 Careted
instance Traversable Careted
instance Foldable Careted
instance Comonad Careted
instance Extend Careted
instance Functor Careted
instance Semigroup Caret
instance Renderable Caret
instance HasDelta Caret
instance HasBytes Caret
instance HasCaret Caret
instance Hashable Caret
module Text.Trifecta.Span
data Span
Span :: !Delta -> !Delta -> {-# UNPACK #-} !ByteString -> Span
class HasSpan t
span :: HasSpan t => t -> Span
data Spanned a
(:~) :: a -> Span -> Spanned a
spanned :: P u a -> P u (Spanned a)
spanEffects :: [ScopedEffect]
drawSpan :: Delta -> Delta -> Delta -> Lines -> Lines
-- |
-- int main(int argc, char ** argv) { int; }
-- ^~~
--
addSpan :: Delta -> Delta -> Render -> Render
instance Eq Span
instance Ord Span
instance Show Span
instance Eq a => Eq (Spanned a)
instance Ord a => Ord (Spanned a)
instance Show a => Show (Spanned a)
instance Hashable a => Hashable (Spanned a)
instance Hashable Span
instance HasCaret (Spanned a)
instance Renderable (Spanned a)
instance HasSpan (Spanned a)
instance Traversable1 Spanned
instance Foldable1 Spanned
instance Traversable Spanned
instance Foldable Spanned
instance Bind Spanned
instance Apply Spanned
instance Comonad Spanned
instance Extend Spanned
instance Functor Spanned
instance Semigroup Span
instance HasSpan Span
instance Renderable Span
instance HasCaret Span
module Text.Trifecta.Fixit
data Fixit
Fixit :: {-# UNPACK #-} !Span -> {-# UNPACK #-} !ByteString -> Fixit
fixitSpan :: Fixit -> {-# UNPACK #-} !Span
fixitReplacement :: Fixit -> {-# UNPACK #-} !ByteString
-- |
-- int main(int argc char ** argv) { int; }
-- ^
-- ,
--
drawFixit :: Delta -> Delta -> String -> Delta -> Lines -> Lines
addFixit :: Delta -> Delta -> String -> Render -> Render
fixit :: P u ByteString -> P u Fixit
instance Eq Fixit
instance Ord Fixit
instance Show Fixit
instance Renderable Fixit
instance Hashable Fixit
instance HasCaret Fixit
instance HasDelta Fixit
instance HasSpan Fixit
module Text.Trifecta.Slice
slice :: Delta -> Delta -> P u ByteString
sliced :: (a -> ByteString -> r) -> P u a -> P u r
module Text.Trifecta.Supply
class Supply t
supply :: Supply t => t -> It a -> It a
supplyList :: Supply t => [t] -> It a -> It a
data EOF
EOF :: EOF
supplyEOF :: It a -> It a
supplyDefault :: Reducer t Rope => t -> It a -> It a
supplyStrand :: Strand -> It a -> It a
supplyHunk :: Hunk -> It a -> It a
supplyPath :: Path -> It a -> It a
supplyByteString :: ByteString -> It a -> It a
instance Supply Rope
instance Supply Strand
instance Supply Path
instance Supply Hunk
instance Supply ByteString
instance Supply ByteString
instance Supply a => Supply [a]
instance Supply Char
instance Supply Word8
instance Supply EOF
module Text.Trifecta