-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | A modern parser combinator library with convenient diagnostics
--   
--   A modern parser combinator library with slicing and Clang-style
--   colored diagnostics
--   
--   For example:
--   
--   
--   (Local Copy)
@package trifecta
@version 2.1.4

-- | Interval maps implemented using the FingerTree type, following
--   section 4.8 of
--   
--   
--   
- Ralf Hinze and Ross Paterson, "Finger trees: a simple
--   general-purpose data structure", Journal of Functional
--   Programming 16:2 (2006) pp 197-217.
--   http://www.soi.city.ac.uk/~ross/papers/FingerTree.html
--   
--   
--   An amortized running time is given for each operation, with n
--   referring to the size of the priority queue. These bounds hold even in
--   a persistent (shared) setting.
--   
--   Note: Many of these operations have the same names as similar
--   operations on lists in the Prelude. The ambiguity may be
--   resolved using either qualification or the hiding clause.
--   
--   Unlike Data.IntervalMap.FingerTree, this version sorts things
--   so that the largest interval from a given point comes first. This way
--   if you have nested intervals, you get the outermost interval before
--   the contained intervals.
module Text.Trifecta.Util.IntervalMap

-- | A closed interval. The lower bound should be less than or equal to the
--   higher bound.
data Interval v
Interval :: v -> v -> Interval v
[low] :: Interval v -> v
[high] :: Interval v -> v

-- | Map of closed intervals, possibly with duplicates. The Foldable
--   and Traversable instances process the intervals in
--   lexicographical order.
newtype IntervalMap v a
IntervalMap :: FingerTree (IntInterval v) (Node v a) -> IntervalMap v a
[runIntervalMap] :: IntervalMap v a -> FingerTree (IntInterval v) (Node v a)

-- | O(1). Interval map with a single entry.
singleton :: Ord v => Interval v -> a -> IntervalMap v a

-- | O(log n). Insert an interval into a map. The map may contain
--   duplicate intervals; the new entry will be inserted before any
--   existing entries for the same interval.
insert :: Ord v => v -> v -> a -> IntervalMap v a -> IntervalMap v a

-- | O(k log (n/k)). All intervals that contain the given
--   point, in lexicographical order.
search :: Ord v => v -> IntervalMap v a -> [(Interval v, a)]

-- | O(k log (n/k)). All intervals that intersect with the
--   given interval, in lexicographical order.
intersections :: Ord v => v -> v -> IntervalMap v a -> [(Interval v, a)]

-- | O(k log (n/k)). All intervals that contain the given
--   interval, in lexicographical order.
dominators :: Ord v => v -> v -> IntervalMap v a -> [(Interval v, a)]

-- | O(n). Add a delta to each interval in the map
offset :: (Ord v, Monoid v) => v -> IntervalMap v a -> IntervalMap v a
data IntInterval v
NoInterval :: IntInterval v
IntInterval :: Interval v -> v -> IntInterval v
fromList :: Ord v => [(v, v, a)] -> IntervalMap v a
instance GHC.Classes.Eq v => GHC.Classes.Eq (Text.Trifecta.Util.IntervalMap.Interval v)
instance GHC.Internal.Data.Foldable.Foldable Text.Trifecta.Util.IntervalMap.Interval
instance GHC.Internal.Data.Foldable.Foldable (Text.Trifecta.Util.IntervalMap.IntervalMap v)
instance GHC.Internal.Data.Foldable.Foldable (Text.Trifecta.Util.IntervalMap.Node v)
instance WithIndex.FoldableWithIndex (Text.Trifecta.Util.IntervalMap.Interval v) (Text.Trifecta.Util.IntervalMap.IntervalMap v)
instance WithIndex.FoldableWithIndex (Text.Trifecta.Util.IntervalMap.Interval v) (Text.Trifecta.Util.IntervalMap.Node v)
instance GHC.Internal.Base.Functor Text.Trifecta.Util.IntervalMap.Interval
instance GHC.Internal.Base.Functor (Text.Trifecta.Util.IntervalMap.IntervalMap v)
instance GHC.Internal.Base.Functor (Text.Trifecta.Util.IntervalMap.Node v)
instance WithIndex.FunctorWithIndex (Text.Trifecta.Util.IntervalMap.Interval v) (Text.Trifecta.Util.IntervalMap.IntervalMap v)
instance WithIndex.FunctorWithIndex (Text.Trifecta.Util.IntervalMap.Interval v) (Text.Trifecta.Util.IntervalMap.Node v)
instance GHC.Classes.Ord v => Data.Semigroup.Union.HasUnion0 (Text.Trifecta.Util.IntervalMap.IntervalMap v a)
instance GHC.Classes.Ord v => Data.Semigroup.Union.HasUnion (Text.Trifecta.Util.IntervalMap.IntervalMap v a)
instance GHC.Classes.Ord v => Data.FingerTree.Measured (Text.Trifecta.Util.IntervalMap.IntInterval v) (Text.Trifecta.Util.IntervalMap.IntervalMap v a)
instance GHC.Classes.Ord v => Data.FingerTree.Measured (Text.Trifecta.Util.IntervalMap.IntInterval v) (Text.Trifecta.Util.IntervalMap.Node v a)
instance GHC.Classes.Ord v => GHC.Internal.Base.Monoid (Text.Trifecta.Util.IntervalMap.IntInterval v)
instance GHC.Classes.Ord v => GHC.Internal.Base.Monoid (Text.Trifecta.Util.IntervalMap.IntervalMap v a)
instance GHC.Classes.Ord v => GHC.Classes.Ord (Text.Trifecta.Util.IntervalMap.Interval v)
instance (GHC.Classes.Ord v, GHC.Internal.Base.Monoid v) => Data.Semigroup.Reducer.Reducer v (Text.Trifecta.Util.IntervalMap.Interval v)
instance GHC.Classes.Ord v => GHC.Internal.Base.Semigroup (Text.Trifecta.Util.IntervalMap.IntInterval v)
instance GHC.Classes.Ord v => GHC.Internal.Base.Semigroup (Text.Trifecta.Util.IntervalMap.Interval v)
instance GHC.Classes.Ord v => GHC.Internal.Base.Semigroup (Text.Trifecta.Util.IntervalMap.IntervalMap v a)
instance GHC.Internal.Show.Show v => GHC.Internal.Show.Show (Text.Trifecta.Util.IntervalMap.Interval v)
instance GHC.Internal.Data.Traversable.Traversable Text.Trifecta.Util.IntervalMap.Interval
instance GHC.Internal.Data.Traversable.Traversable (Text.Trifecta.Util.IntervalMap.IntervalMap v)
instance GHC.Internal.Data.Traversable.Traversable (Text.Trifecta.Util.IntervalMap.Node v)
instance WithIndex.TraversableWithIndex (Text.Trifecta.Util.IntervalMap.Interval v) (Text.Trifecta.Util.IntervalMap.IntervalMap v)
instance WithIndex.TraversableWithIndex (Text.Trifecta.Util.IntervalMap.Interval v) (Text.Trifecta.Util.IntervalMap.Node v)

-- | A Delta keeps track of the cursor position of the parser, so it
--   can be referred to later, for example in error messages.
module Text.Trifecta.Delta

-- | Since there are multiple ways to be at a certain location,
--   Delta captures all these alternatives as a single type.
data Delta

-- | 
--   ( number of characters
--   , number of bytes )
--   
Columns :: {-# UNPACK #-} !Int64 -> {-# UNPACK #-} !Int64 -> Delta

-- | 
--   ( number of characters before the tab
--   , number of characters after the tab
--   , number of bytes )
--   
Tab :: {-# UNPACK #-} !Int64 -> {-# UNPACK #-} !Int64 -> {-# UNPACK #-} !Int64 -> Delta

-- | 
--   ( number of newlines contained
--   , number of characters since the last newline
--   , number of bytes
--   , number of bytes since the last newline )
--   
Lines :: {-# UNPACK #-} !Int64 -> {-# UNPACK #-} !Int64 -> {-# UNPACK #-} !Int64 -> {-# UNPACK #-} !Int64 -> Delta

-- | 
--   ( current file name
--   , number of lines since the last line directive
--   , number of characters since the last newline
--   , number of bytes
--   , number of bytes since the last newline )
--   
Directed :: !ByteString -> {-# UNPACK #-} !Int64 -> {-# UNPACK #-} !Int64 -> {-# UNPACK #-} !Int64 -> {-# UNPACK #-} !Int64 -> Delta
class HasDelta t
delta :: HasDelta t => t -> Delta
class HasBytes t
bytes :: HasBytes t => t -> Int64

-- | Example: file.txt:12:34
prettyDelta :: Delta -> Doc AnsiStyle

-- | Increment a column number to the next tabstop.
nextTab :: Int64 -> Int64

-- | Rewind a Delta to the beginning of the line.
rewind :: Delta -> Delta

-- | Should we show two things with a Delta on the same line?
--   
--   
--   >>> near (Columns 0 0) (Columns 5 5)
--   True
--   
--   
--   
--   >>> near (Lines 1 0 1 0) (Lines 2 4 4 2)
--   False
--   
near :: (HasDelta s, HasDelta t) => s -> t -> Bool

-- | Retrieve the character offset within the current line from this
--   Delta.
column :: HasDelta t => t -> Int64

-- | Retrieve the byte offset within the current line from this
--   Delta.
columnByte :: Delta -> Int64
instance GHC.Internal.Data.Data.Data Text.Trifecta.Delta.Delta
instance GHC.Classes.Eq Text.Trifecta.Delta.Delta
instance GHC.Internal.Generics.Generic Text.Trifecta.Delta.Delta
instance Text.Trifecta.Delta.HasBytes Data.ByteString.Internal.Type.ByteString
instance Text.Trifecta.Delta.HasBytes Text.Trifecta.Delta.Delta
instance (Data.FingerTree.Measured v a, Text.Trifecta.Delta.HasBytes v) => Text.Trifecta.Delta.HasBytes (Data.FingerTree.FingerTree v a)
instance Text.Trifecta.Delta.HasDelta Data.ByteString.Internal.Type.ByteString
instance Text.Trifecta.Delta.HasDelta GHC.Types.Char
instance Text.Trifecta.Delta.HasDelta Text.Trifecta.Delta.Delta
instance (Text.Trifecta.Delta.HasDelta l, Text.Trifecta.Delta.HasDelta r) => Text.Trifecta.Delta.HasDelta (GHC.Internal.Data.Either.Either l r)
instance (Data.FingerTree.Measured v a, Text.Trifecta.Delta.HasDelta v) => Text.Trifecta.Delta.HasDelta (Data.FingerTree.FingerTree v a)
instance Text.Trifecta.Delta.HasDelta GHC.Internal.Word.Word8
instance Data.Hashable.Class.Hashable Text.Trifecta.Delta.Delta
instance GHC.Internal.Base.Monoid Text.Trifecta.Delta.Delta
instance GHC.Classes.Ord Text.Trifecta.Delta.Delta
instance GHC.Internal.Base.Semigroup Text.Trifecta.Delta.Delta
instance GHC.Internal.Show.Show Text.Trifecta.Delta.Delta

-- | A rope is a data strucure to efficiently store and manipulate long
--   strings. Wikipedia provides a nice overview:
--   https://en.wikipedia.org/wiki/Rope_(data_structure)
module Text.Trifecta.Rope
data Rope
Rope :: !Delta -> !FingerTree Delta Strand -> Rope
rope :: FingerTree Delta Strand -> Rope

-- | Construct a Rope out of a single ByteString strand.
ropeBS :: ByteString -> Rope
data Strand

-- | Data of a certain length
Strand :: {-# UNPACK #-} !ByteString -> !Delta -> Strand

-- | Absence of data of a certain length
Skipping :: !Delta -> Strand

-- | Construct a single Strand out of a ByteString.
strand :: ByteString -> Strand
strands :: Rope -> FingerTree Delta Strand

-- | Grab the entire rest of the input Rope, starting at an initial
--   offset, or return a default if we’re already at or beyond the end.
--   Also see grabLine.
--   
--   Extract a suffix of a certain length from the input:
--   
--   
--   >>> grabRest (delta ("Hello " :: ByteString)) (ropeBS "Hello World\nLorem") Nothing (\x y -> Just (x, Lazy.toString y))
--   Just (Columns 6 6,"World\nLorem")
--   
--   
--   Same deal, but over multiple strands:
--   
--   
--   >>> grabRest (delta ("Hel" :: ByteString)) (ropeBS "Hello" <> ropeBS "World") Nothing (\x y -> Just (x, Lazy.toString y))
--   Just (Columns 3 3,"loWorld")
--   
--   
--   When the offset is too long, fall back to a default:
--   
--   
--   >>> grabRest (delta ("OffetTooLong" :: ByteString)) (ropeBS "Hello") Nothing (\x y -> Just (x, Lazy.toString y))
--   Nothing
--   
grabRest :: Delta -> Rope -> r -> (Delta -> ByteString -> r) -> r

-- | Grab the rest of the line at a certain offset in the input
--   Rope, or return a default if there is no newline left in the
--   input. Also see grabRest.
--   
--   
--   >>> grabLine (delta ("Hello " :: ByteString)) (ropeBS "Hello" <> ropeBS " World\nLorem") Nothing (\x y -> Just (x, Strict.toString y))
--   Just (Columns 6 6,"World\n")
--   
grabLine :: Delta -> Rope -> r -> (Delta -> ByteString -> r) -> r
instance GHC.Internal.Data.Data.Data Text.Trifecta.Rope.Strand
instance GHC.Classes.Eq Text.Trifecta.Rope.Strand
instance GHC.Internal.Generics.Generic Text.Trifecta.Rope.Strand
instance Text.Trifecta.Delta.HasBytes Text.Trifecta.Rope.Rope
instance Text.Trifecta.Delta.HasBytes Text.Trifecta.Rope.Strand
instance Text.Trifecta.Delta.HasDelta Text.Trifecta.Rope.Rope
instance Text.Trifecta.Delta.HasDelta Text.Trifecta.Rope.Strand
instance Data.Hashable.Class.Hashable Text.Trifecta.Rope.Strand
instance Data.FingerTree.Measured Text.Trifecta.Delta.Delta Text.Trifecta.Rope.Rope
instance Data.FingerTree.Measured Text.Trifecta.Delta.Delta Text.Trifecta.Rope.Strand
instance GHC.Internal.Base.Monoid Text.Trifecta.Rope.Rope
instance Data.Semigroup.Reducer.Reducer Data.ByteString.Internal.Type.ByteString Text.Trifecta.Rope.Rope
instance Data.Semigroup.Reducer.Reducer [GHC.Types.Char] Text.Trifecta.Rope.Rope
instance Data.Semigroup.Reducer.Reducer Text.Trifecta.Rope.Rope Text.Trifecta.Rope.Rope
instance Data.Semigroup.Reducer.Reducer Text.Trifecta.Rope.Strand Text.Trifecta.Rope.Rope
instance GHC.Internal.Base.Semigroup Text.Trifecta.Rope.Rope
instance GHC.Internal.Show.Show Text.Trifecta.Rope.Rope
instance GHC.Internal.Show.Show Text.Trifecta.Rope.Strand

-- | harder, better, faster, stronger...
module Text.Trifecta.Util.It

-- | It is an Iteratee that can produce partial
--   results.
--   
--   It r a consumes a feed of rs and produces
--   as on the way. New values can be fed using
--   simplifyIt, the current (partial or final) result is
--   extracted using extract.
--   
--   
--   >>> let keepIt    a = Pure a
--   
--   >>> let replaceIt a = It a replaceIt
--   
--   
--   
--   >>> extract (keepIt 0)
--   0
--   
--   
--   
--   >>> extract (replaceIt 0)
--   0
--   
--   
--   
--   >>> extract (simplifyIt (keepIt 0) 5)
--   0
--   
--   
--   
--   >>> extract (simplifyIt (replaceIt 0) 5)
--   5
--   
data It r a

-- | Final result, rest of the feed is discarded
Pure :: a -> It r a

-- | Intermediate result, consumed values produce new results
It :: a -> (r -> It r a) -> It r a

-- | Consumes input until a value can be produced.
--   
--   
--   >>> :{
--   let needTen = needIt 0 (\n -> if n < 10 then Nothing else Just n) :: It Int Int
--   :}
--   
--   
--   
--   >>> extract needTen
--   0
--   
--   
--   
--   >>> extract (simplifyIt needTen 5)
--   0
--   
--   
--   
--   >>> extract (simplifyIt needTen 11)
--   11
--   
--   
--   
--   >>> extract (simplifyIt (simplifyIt (simplifyIt needTen 5) 11) 15)
--   11
--   
needIt :: a -> (r -> Maybe a) -> It r a

-- | Consumes input and produces partial results until a condition is met.
--   Unlike needIt, partial results are already returned when the
--   condition is not fulfilled yet.
--   
--   
--   >>> :{
--   let wantTen :: It Int Int
--       wantTen = wantIt 0 (\n -> (# n >= 10, n #))
--   :}
--   
--   
--   
--   >>> extract wantTen
--   0
--   
--   
--   
--   >>> extract (simplifyIt wantTen 5)
--   5
--   
--   
--   
--   >>> extract (simplifyIt wantTen 11)
--   11
--   
--   
--   
--   >>> extract (simplifyIt (simplifyIt (simplifyIt wantTen 5) 11) 15)
--   11
--   
wantIt :: a -> (r -> (# Bool, a #)) -> It r a

-- | Feed a value to It, obtaining a new (partial or final) result.
simplifyIt :: It r a -> r -> It r a

-- | The generalized fold (Böhm-Berarducci decoding) over 'It r a'.
--   
--   foldIt satisfies the property:
--   
--   
--   foldIt Pure It = id
--   
foldIt :: (a -> o) -> (a -> (r -> o) -> o) -> It r a -> o

-- | Scott decoding of 'It r a'.
--   
--   The scott decoding is similar to the generalized fold over a data
--   type, but leaves the recursion step to the calling function.
--   
--   runIt satiesfies the property:
--   
--   
--   runIt Pure It = id
--   
--   
--   See also the Scott decoding of lists:
--   
--   
--   runList :: (a -> [a] -> b) -> b -> [a] -> b
--   
--   
--   and compare it with foldr (the Böhm-Berarducci decoding for
--   lists):
--   
--   
--   foldr :: (a -> b -> b) -> b -> [a] -> b
--   
runIt :: (a -> o) -> (a -> (r -> It r a) -> o) -> It r a -> o

-- | Given a position, go there, and grab the rest of the line forward from
--   that point.
--   
--   
--   >>> :set -XOverloadedStrings
--   
--   >>> let secondLine = fillIt Nothing (const Just) (delta ("foo\nb" :: Strict.ByteString))
--   
--   
--   
--   >>> extract secondLine
--   Nothing
--   
--   
--   
--   >>> extract (simplifyIt secondLine (ropeBS "foo"))
--   Nothing
--   
--   
--   
--   >>> extract (simplifyIt secondLine (ropeBS "foo\nbar"))
--   Just "ar"
--   
--   
--   
--   >>> extract (simplifyIt secondLine (ropeBS "foo\nbar\nbaz"))
--   Just "ar\n"
--   
fillIt :: r -> (Delta -> ByteString -> r) -> Delta -> It Rope r

-- | Return the text of the line that contains a given position
--   
--   
--   >>> :set -XOverloadedStrings
--   
--   >>> let secondLine = rewindIt (delta ("foo\nb" :: Strict.ByteString))
--   
--   
--   
--   >>> extract secondLine
--   Nothing
--   
--   
--   
--   >>> extract (simplifyIt secondLine (ropeBS "foo"))
--   Nothing
--   
--   
--   
--   >>> extract (simplifyIt secondLine (ropeBS "foo\nbar"))
--   Just "bar"
--   
--   
--   
--   >>> extract (simplifyIt secondLine (ropeBS "foo\nbar\nbaz"))
--   Just "bar\n"
--   
rewindIt :: Delta -> It Rope (Maybe ByteString)

-- | Return the text between two offsets.
--   
--   
--   >>> :set -XOverloadedStrings
--   
--   >>> let secondLine = sliceIt (delta ("foo\n" :: Strict.ByteString)) (delta ("foo\nbar\n" :: Strict.ByteString))
--   
--   
--   
--   >>> extract secondLine
--   ""
--   
--   
--   
--   >>> extract (simplifyIt secondLine (ropeBS "foo"))
--   ""
--   
--   
--   
--   >>> extract (simplifyIt secondLine (ropeBS "foo\nbar"))
--   "bar"
--   
--   
--   
--   >>> extract (simplifyIt secondLine (ropeBS "foo\nbar\nbaz"))
--   "bar\n"
--   
sliceIt :: Delta -> Delta -> It Rope ByteString
instance GHC.Internal.Base.Applicative (Text.Trifecta.Util.It.It r)
instance Control.Comonad.ComonadApply (Text.Trifecta.Util.It.It r)
instance Control.Comonad.Comonad (Text.Trifecta.Util.It.It r)
instance GHC.Internal.Base.Functor (Text.Trifecta.Util.It.It r)
instance GHC.Internal.Base.Monad (Text.Trifecta.Util.It.It r)
instance Data.Profunctor.Unsafe.Profunctor Text.Trifecta.Util.It.It
instance GHC.Internal.Show.Show a => GHC.Internal.Show.Show (Text.Trifecta.Util.It.It r a)

-- | The type for Lines will very likely change over time, to enable
--   drawing lit up multi-character versions of control characters for
--   ^Z, ^[, 0xff, etc. This will make
--   for much nicer diagnostics when working with protocols.
module Text.Trifecta.Rendering

-- | A Rendering is a canvas of text that output can be written to.
data Rendering
Rendering :: !Delta -> {-# UNPACK #-} !Int64 -> {-# UNPACK #-} !Int64 -> (Lines -> Lines) -> (Delta -> Lines -> Lines) -> Rendering
class HasRendering c
rendering :: HasRendering c => Lens' c Rendering
renderingDelta :: HasRendering c => Lens' c Delta
renderingLine :: HasRendering c => Lens' c (Lines -> Lines)
renderingLineBytes :: HasRendering c => Lens' c Int64
renderingLineLen :: HasRendering c => Lens' c Int64
renderingOverlays :: HasRendering c => Lens' c (Delta -> Lines -> Lines)

-- | Is the Rendering empty?
--   
--   
--   >>> nullRendering emptyRendering
--   True
--   
--   
--   
--   >>> nullRendering exampleRendering
--   False
--   
nullRendering :: Rendering -> Bool

-- | The empty Rendering, which contains nothing at all.
--   
--   
--   >>> show (prettyRendering emptyRendering)
--   ""
--   
emptyRendering :: Rendering
prettyRendering :: Rendering -> Doc AnsiStyle
class Source t

-- | 
--   ( Number of (padded) columns
--   , number of bytes
--   , line )
--   
source :: Source t => t -> (Int64, Int64, Lines -> Lines)

-- | create a drawing surface
rendered :: Source s => Delta -> s -> Rendering
class Renderable t
render :: Renderable t => t -> Rendering
data Rendered a
(:@) :: a -> Rendering -> Rendered a

-- | ANSI terminal style for rendering the gutter.
gutterEffects :: [SGR]

-- | A Caret marks a point in the input with a simple ^
--   character.
--   
--   
--   >>> unAnnotate (prettyRendering (addCaret (Columns 35 35) exampleRendering))
--   1 | int main(int argc, char ** argv) { int; }<EOF>
--     |                                    ^
--   
data Caret
Caret :: !Delta -> {-# UNPACK #-} !ByteString -> Caret
class HasCaret t
caret :: HasCaret t => Lens' t Caret
data Careted a
(:^) :: a -> Caret -> Careted a
drawCaret :: Delta -> Delta -> Lines -> Lines

-- | Render a caret at a certain position in a Rendering.
addCaret :: Delta -> Rendering -> Rendering

-- | ANSI terminal style for rendering the caret.
caretEffects :: [SGR]
renderingCaret :: Delta -> ByteString -> Rendering

-- | A Span marks a range of input characters. If Caret is a
--   point, then Span is a line.
--   
--   
--   >>> unAnnotate (prettyRendering (addSpan (Columns 35 35) (Columns 38 38) exampleRendering))
--   1 | int main(int argc, char ** argv) { int; }<EOF>
--     |                                    ~~~
--   
data Span
Span :: !Delta -> !Delta -> {-# UNPACK #-} !ByteString -> Span
class HasSpan t
span :: HasSpan t => Lens' t Span

-- | Annotate an arbitrary piece of data with a Span, typically its
--   corresponding input location.
data Spanned a
(:~) :: a -> Span -> Spanned a

-- | ANSI terminal style to render spans with.
spanEffects :: [SGR]
drawSpan :: Delta -> Delta -> Delta -> Lines -> Lines
addSpan :: Delta -> Delta -> Rendering -> Rendering

-- | A Fixit is a Span with a suggestion.
--   
--   
--   >>> unAnnotate (prettyRendering (addFixit (Columns 35 35) (Columns 38 38) "Fix this!" exampleRendering))
--   1 | int main(int argc, char ** argv) { int; }<EOF>
--     |                                    ~~~
--     |                                    Fix this!
--   
data Fixit
Fixit :: {-# UNPACK #-} !Span -> !ByteString -> Fixit

-- | Span where the error occurred
[_fixitSpan] :: Fixit -> {-# UNPACK #-} !Span

-- | Replacement suggestion
[_fixitReplacement] :: Fixit -> !ByteString
class HasFixit c
fixit :: HasFixit c => Lens' c Fixit
fixitReplacement :: HasFixit c => Lens' c ByteString
fixitSpan :: HasFixit c => Lens' c Span
drawFixit :: Delta -> Delta -> String -> Delta -> Lines -> Lines
addFixit :: Delta -> Delta -> String -> Rendering -> Rendering

-- | A raw canvas to paint ANSI-styled characters on.
type Lines = Array (Int, Int64) ([SGR], Char)
draw :: [SGR] -> Int -> Int64 -> String -> Lines -> Lines
ifNear :: Delta -> (Lines -> Lines) -> Delta -> Lines -> Lines
(.#) :: (Delta -> Lines -> Lines) -> Rendering -> Rendering
instance Control.Comonad.ComonadApply Text.Trifecta.Rendering.Careted
instance Control.Comonad.ComonadApply Text.Trifecta.Rendering.Rendered
instance Control.Comonad.ComonadApply Text.Trifecta.Rendering.Spanned
instance Control.Comonad.Comonad Text.Trifecta.Rendering.Careted
instance Control.Comonad.Comonad Text.Trifecta.Rendering.Rendered
instance Control.Comonad.Comonad Text.Trifecta.Rendering.Spanned
instance GHC.Internal.Data.Data.Data Text.Trifecta.Rendering.Caret
instance GHC.Internal.Data.Data.Data a => GHC.Internal.Data.Data.Data (Text.Trifecta.Rendering.Careted a)
instance GHC.Internal.Data.Data.Data Text.Trifecta.Rendering.Fixit
instance GHC.Internal.Data.Data.Data Text.Trifecta.Rendering.Span
instance GHC.Internal.Data.Data.Data a => GHC.Internal.Data.Data.Data (Text.Trifecta.Rendering.Spanned a)
instance GHC.Classes.Eq Text.Trifecta.Rendering.Caret
instance GHC.Classes.Eq a => GHC.Classes.Eq (Text.Trifecta.Rendering.Careted a)
instance GHC.Classes.Eq Text.Trifecta.Rendering.Fixit
instance GHC.Classes.Eq Text.Trifecta.Rendering.Span
instance GHC.Classes.Eq a => GHC.Classes.Eq (Text.Trifecta.Rendering.Spanned a)
instance GHC.Internal.Data.Foldable.Foldable Text.Trifecta.Rendering.Careted
instance GHC.Internal.Data.Foldable.Foldable Text.Trifecta.Rendering.Rendered
instance GHC.Internal.Data.Foldable.Foldable Text.Trifecta.Rendering.Spanned
instance GHC.Internal.Base.Functor Text.Trifecta.Rendering.Careted
instance GHC.Internal.Base.Functor Text.Trifecta.Rendering.Rendered
instance GHC.Internal.Base.Functor Text.Trifecta.Rendering.Spanned
instance GHC.Internal.Generics.Generic Text.Trifecta.Rendering.Caret
instance GHC.Internal.Generics.Generic (Text.Trifecta.Rendering.Careted a)
instance GHC.Internal.Generics.Generic Text.Trifecta.Rendering.Fixit
instance GHC.Internal.Generics.Generic Text.Trifecta.Rendering.Span
instance GHC.Internal.Generics.Generic (Text.Trifecta.Rendering.Spanned a)
instance Text.Trifecta.Delta.HasBytes Text.Trifecta.Rendering.Caret
instance Text.Trifecta.Delta.HasBytes (Text.Trifecta.Rendering.Careted a)
instance Text.Trifecta.Delta.HasBytes (Text.Trifecta.Rendering.Rendered a)
instance Text.Trifecta.Rendering.HasCaret Text.Trifecta.Rendering.Caret
instance Text.Trifecta.Rendering.HasCaret (Text.Trifecta.Rendering.Careted a)
instance Text.Trifecta.Delta.HasDelta Text.Trifecta.Rendering.Caret
instance Text.Trifecta.Delta.HasDelta (Text.Trifecta.Rendering.Careted a)
instance Text.Trifecta.Delta.HasDelta (Text.Trifecta.Rendering.Rendered a)
instance Text.Trifecta.Delta.HasDelta Text.Trifecta.Rendering.Rendering
instance Text.Trifecta.Rendering.HasFixit Text.Trifecta.Rendering.Fixit
instance Text.Trifecta.Rendering.HasRendering Text.Trifecta.Rendering.Rendering
instance Text.Trifecta.Rendering.HasSpan Text.Trifecta.Rendering.Fixit
instance Text.Trifecta.Rendering.HasSpan Text.Trifecta.Rendering.Span
instance Text.Trifecta.Rendering.HasSpan (Text.Trifecta.Rendering.Spanned a)
instance Data.Hashable.Class.Hashable Text.Trifecta.Rendering.Caret
instance Data.Hashable.Class.Hashable a => Data.Hashable.Class.Hashable (Text.Trifecta.Rendering.Careted a)
instance Data.Hashable.Class.Hashable Text.Trifecta.Rendering.Fixit
instance Data.Hashable.Class.Hashable Text.Trifecta.Rendering.Span
instance Data.Hashable.Class.Hashable a => Data.Hashable.Class.Hashable (Text.Trifecta.Rendering.Spanned a)
instance GHC.Internal.Base.Monoid Text.Trifecta.Rendering.Rendering
instance GHC.Classes.Ord Text.Trifecta.Rendering.Caret
instance GHC.Classes.Ord a => GHC.Classes.Ord (Text.Trifecta.Rendering.Careted a)
instance GHC.Classes.Ord Text.Trifecta.Rendering.Fixit
instance GHC.Classes.Ord Text.Trifecta.Rendering.Span
instance GHC.Classes.Ord a => GHC.Classes.Ord (Text.Trifecta.Rendering.Spanned a)
instance Data.Semigroup.Reducer.Reducer Text.Trifecta.Rendering.Caret Text.Trifecta.Rendering.Rendering
instance Data.Semigroup.Reducer.Reducer (Text.Trifecta.Rendering.Careted a) Text.Trifecta.Rendering.Rendering
instance Data.Semigroup.Reducer.Reducer Text.Trifecta.Rendering.Fixit Text.Trifecta.Rendering.Rendering
instance Data.Semigroup.Reducer.Reducer Text.Trifecta.Rendering.Span Text.Trifecta.Rendering.Rendering
instance Data.Semigroup.Reducer.Reducer (Text.Trifecta.Rendering.Spanned a) Text.Trifecta.Rendering.Rendering
instance Text.Trifecta.Rendering.Renderable Text.Trifecta.Rendering.Caret
instance Text.Trifecta.Rendering.Renderable (Text.Trifecta.Rendering.Careted a)
instance Text.Trifecta.Rendering.Renderable Text.Trifecta.Rendering.Fixit
instance Text.Trifecta.Rendering.Renderable (Text.Trifecta.Rendering.Rendered a)
instance Text.Trifecta.Rendering.Renderable Text.Trifecta.Rendering.Rendering
instance Text.Trifecta.Rendering.Renderable Text.Trifecta.Rendering.Span
instance Text.Trifecta.Rendering.Renderable (Text.Trifecta.Rendering.Spanned a)
instance GHC.Internal.Base.Semigroup Text.Trifecta.Rendering.Caret
instance GHC.Internal.Base.Semigroup Text.Trifecta.Rendering.Rendering
instance GHC.Internal.Base.Semigroup Text.Trifecta.Rendering.Span
instance GHC.Internal.Show.Show Text.Trifecta.Rendering.Caret
instance GHC.Internal.Show.Show a => GHC.Internal.Show.Show (Text.Trifecta.Rendering.Careted a)
instance GHC.Internal.Show.Show Text.Trifecta.Rendering.Fixit
instance GHC.Internal.Show.Show a => GHC.Internal.Show.Show (Text.Trifecta.Rendering.Rendered a)
instance GHC.Internal.Show.Show Text.Trifecta.Rendering.Rendering
instance GHC.Internal.Show.Show Text.Trifecta.Rendering.Span
instance GHC.Internal.Show.Show a => GHC.Internal.Show.Show (Text.Trifecta.Rendering.Spanned a)
instance Text.Trifecta.Rendering.Source Data.ByteString.Internal.Type.ByteString
instance Text.Trifecta.Rendering.Source GHC.Internal.Base.String
instance GHC.Internal.Data.Traversable.Traversable Text.Trifecta.Rendering.Careted
instance GHC.Internal.Data.Traversable.Traversable Text.Trifecta.Rendering.Rendered
instance GHC.Internal.Data.Traversable.Traversable Text.Trifecta.Rendering.Spanned

-- | Results and Parse Errors
module Text.Trifecta.Result

-- | The result of parsing. Either we succeeded or something went wrong.
data Result a
Success :: a -> Result a
Failure :: ErrInfo -> Result a

-- | A Prism that lets you embed or retrieve a Result in a
--   potentially larger type.
class AsResult s t a b | s -> a, t -> b, s b -> t, t a -> s
_Result :: AsResult s t a b => Prism s t (Result a) (Result b)

-- | Fold over a Result
foldResult :: (ErrInfo -> b) -> (a -> b) -> Result a -> b

-- | The Prism for the Success constructor of Result
_Success :: AsResult s t a b => Prism s t a b

-- | The Prism for the Failure constructor of Result
_Failure :: AsResult s s a a => Prism' s ErrInfo

-- | This is used to report an error. What went wrong, some supplemental
--   docs and a set of things expected at the current location. This does
--   not, however, include the actual location.
data Err
Err :: Maybe (Doc AnsiStyle) -> [Doc AnsiStyle] -> Set String -> [Delta] -> Err
[_reason] :: Err -> Maybe (Doc AnsiStyle)
[_footnotes] :: Err -> [Doc AnsiStyle]
[_expected] :: Err -> Set String
[_finalDeltas] :: Err -> [Delta]
class HasErr c
err :: HasErr c => Lens' c Err
expected :: HasErr c => Lens' c (Set String)
finalDeltas :: HasErr c => Lens' c [Delta]
footnotes :: HasErr c => Lens' c [Doc AnsiStyle]
reason :: HasErr c => Lens' c (Maybe (Doc AnsiStyle))
class Errable (m :: Type -> Type)
raiseErr :: Errable m => Err -> m a
data ErrInfo
ErrInfo :: Doc AnsiStyle -> [Delta] -> ErrInfo
[_errDoc] :: ErrInfo -> Doc AnsiStyle
[_errDeltas] :: ErrInfo -> [Delta]

-- | Convert a Rendering of auxiliary information and an Err
--   into a 'Doc AnsiStyle', ready to be prettyprinted to the user.
explain :: Rendering -> Err -> Doc AnsiStyle

-- | Generate a simple Err word-wrapping the supplied message.
failed :: String -> Err
instance GHC.Internal.Base.Alternative Text.Trifecta.Result.Result
instance GHC.Internal.Base.Applicative Text.Trifecta.Result.Result
instance Text.Trifecta.Result.AsResult (Text.Trifecta.Result.Result a) (Text.Trifecta.Result.Result b) a b
instance GHC.Internal.Data.Foldable.Foldable Text.Trifecta.Result.Result
instance GHC.Internal.Base.Functor Text.Trifecta.Result.Result
instance Text.Trifecta.Result.HasErr Text.Trifecta.Result.Err
instance GHC.Internal.Base.Monad Text.Trifecta.Result.Result
instance GHC.Internal.Base.Monoid Text.Trifecta.Result.Err
instance GHC.Internal.Base.Monoid Text.Trifecta.Result.ErrInfo
instance GHC.Internal.Base.Semigroup Text.Trifecta.Result.Err
instance GHC.Internal.Base.Semigroup Text.Trifecta.Result.ErrInfo
instance GHC.Internal.Show.Show Text.Trifecta.Result.ErrInfo
instance GHC.Internal.Show.Show a => GHC.Internal.Show.Show (Text.Trifecta.Result.Result a)
instance GHC.Internal.Data.Traversable.Traversable Text.Trifecta.Result.Result

module Text.Trifecta.Highlight

-- | Tags used by the TokenParsing highlight combinator.
data Highlight

-- | A HighlightedRope is a Rope with an associated
--   IntervalMap full of highlighted regions.
data HighlightedRope
HighlightedRope :: !IntervalMap Delta Highlight -> {-# UNPACK #-} !Rope -> HighlightedRope
class HasHighlightedRope c
highlightedRope :: HasHighlightedRope c => Lens' c HighlightedRope
ropeContent :: HasHighlightedRope c => Lens' c Rope
ropeHighlights :: HasHighlightedRope c => Lens' c (IntervalMap Delta Highlight)

-- | Convert a Highlight into a coloration on a Doc.
withHighlight :: Highlight -> Doc AnsiStyle -> Doc AnsiStyle

-- | Represents a source file like an HsColour rendered document
data HighlightDoc
HighlightDoc :: String -> String -> HighlightedRope -> HighlightDoc
class HasHighlightDoc c
highlightDoc :: HasHighlightDoc c => Lens' c HighlightDoc
docContent :: HasHighlightDoc c => Lens' c HighlightedRope
docCss :: HasHighlightDoc c => Lens' c String
docTitle :: HasHighlightDoc c => Lens' c String

-- | Generate an HTML document from a title and a HighlightedRope.
doc :: String -> HighlightedRope -> HighlightDoc
instance GHC.Classes.Eq (Text.Trifecta.Highlight.Located a)
instance Text.Trifecta.Delta.HasBytes Text.Trifecta.Highlight.HighlightedRope
instance Text.Trifecta.Delta.HasDelta Text.Trifecta.Highlight.HighlightedRope
instance Text.Trifecta.Highlight.HasHighlightDoc Text.Trifecta.Highlight.HighlightDoc
instance Text.Trifecta.Highlight.HasHighlightedRope Text.Trifecta.Highlight.HighlightedRope
instance GHC.Internal.Base.Monoid Text.Trifecta.Highlight.HighlightedRope
instance GHC.Classes.Ord (Text.Trifecta.Highlight.Located a)
instance GHC.Internal.Base.Semigroup Text.Trifecta.Highlight.HighlightedRope
instance Text.Blaze.ToMarkup Text.Trifecta.Highlight.HighlightDoc
instance Text.Blaze.ToMarkup Text.Trifecta.Highlight.HighlightedRope

module Text.Trifecta.Combinators

-- | This class provides parsers with easy access to:
--   
--   1) the current line contents. 2) the current position as a
--   Delta. 3) the ability to use sliced on any parser.
class (MonadPlus m, TokenParsing m) => DeltaParsing (m :: Type -> Type)

-- | Retrieve the contents of the current line (from the beginning of the
--   line)
line :: DeltaParsing m => m ByteString

-- | Retrieve the current position as a Delta.
position :: DeltaParsing m => m Delta

-- | Run a parser, grabbing all of the text between its start and end
--   points
slicedWith :: DeltaParsing m => (a -> ByteString -> r) -> m a -> m r

-- | Retrieve a Rendering of the current line noting this position,
--   but not placing a Caret there.
rend :: DeltaParsing m => m Rendering

-- | Grab the remainder of the current line
restOfLine :: DeltaParsing m => m ByteString

-- | Run a parser, grabbing all of the text between its start and end
--   points and discarding the original result
sliced :: DeltaParsing m => m a -> m ByteString

-- | Grab a Caret pointing to the current location.
careting :: DeltaParsing m => m Caret

-- | Parse a Careted result. Pointing the Caret to where you
--   start.
careted :: DeltaParsing m => m a -> m (Careted a)

-- | Discard the result of a parse, returning a Span from where we
--   start to where it ended parsing.
spanning :: DeltaParsing m => m a -> m Span

-- | Parse a Spanned result. The Span starts here and runs to
--   the last position parsed.
spanned :: DeltaParsing m => m a -> m (Spanned a)

-- | Grab a fixit.
fixiting :: DeltaParsing m => m ByteString -> m Fixit

-- | This class is a refinement of DeltaParsing that adds the
--   ability to mark your position in the input and return there for
--   further parsing later.
class (DeltaParsing m, HasDelta d) => MarkParsing d (m :: Type -> Type) | m -> d

-- | mark the current location so it can be used in constructing a span, or
--   for later seeking
mark :: MarkParsing d m => m d

-- | Seek a previously marked location
release :: MarkParsing d m => d -> m ()
instance (GHC.Internal.Base.MonadPlus m, Text.Trifecta.Combinators.DeltaParsing m) => Text.Trifecta.Combinators.DeltaParsing (Control.Monad.Trans.Identity.IdentityT m)
instance (GHC.Internal.Base.MonadPlus m, Text.Trifecta.Combinators.DeltaParsing m, GHC.Internal.Base.Monoid w) => Text.Trifecta.Combinators.DeltaParsing (Control.Monad.Trans.RWS.Strict.RWST r w s m)
instance (GHC.Internal.Base.MonadPlus m, Text.Trifecta.Combinators.DeltaParsing m, GHC.Internal.Base.Monoid w) => Text.Trifecta.Combinators.DeltaParsing (Control.Monad.Trans.RWS.Lazy.RWST r w s m)
instance (GHC.Internal.Base.MonadPlus m, Text.Trifecta.Combinators.DeltaParsing m) => Text.Trifecta.Combinators.DeltaParsing (Control.Monad.Trans.Reader.ReaderT e m)
instance (GHC.Internal.Base.MonadPlus m, Text.Trifecta.Combinators.DeltaParsing m) => Text.Trifecta.Combinators.DeltaParsing (Control.Monad.Trans.State.Strict.StateT s m)
instance (GHC.Internal.Base.MonadPlus m, Text.Trifecta.Combinators.DeltaParsing m) => Text.Trifecta.Combinators.DeltaParsing (Control.Monad.Trans.State.Lazy.StateT s m)
instance (GHC.Internal.Base.MonadPlus m, Text.Trifecta.Combinators.DeltaParsing m, GHC.Internal.Base.Monoid w) => Text.Trifecta.Combinators.DeltaParsing (Control.Monad.Trans.Writer.Lazy.WriterT w m)
instance (GHC.Internal.Base.MonadPlus m, Text.Trifecta.Combinators.DeltaParsing m, GHC.Internal.Base.Monoid w) => Text.Trifecta.Combinators.DeltaParsing (Control.Monad.Trans.Writer.Strict.WriterT w m)
instance (GHC.Internal.Base.MonadPlus m, Text.Trifecta.Combinators.MarkParsing d m) => Text.Trifecta.Combinators.MarkParsing d (Control.Monad.Trans.Identity.IdentityT m)
instance (GHC.Internal.Base.MonadPlus m, Text.Trifecta.Combinators.MarkParsing d m, GHC.Internal.Base.Monoid w) => Text.Trifecta.Combinators.MarkParsing d (Control.Monad.Trans.RWS.Strict.RWST r w s m)
instance (GHC.Internal.Base.MonadPlus m, Text.Trifecta.Combinators.MarkParsing d m, GHC.Internal.Base.Monoid w) => Text.Trifecta.Combinators.MarkParsing d (Control.Monad.Trans.RWS.Lazy.RWST r w s m)
instance (GHC.Internal.Base.MonadPlus m, Text.Trifecta.Combinators.MarkParsing d m) => Text.Trifecta.Combinators.MarkParsing d (Control.Monad.Trans.Reader.ReaderT e m)
instance (GHC.Internal.Base.MonadPlus m, Text.Trifecta.Combinators.MarkParsing d m) => Text.Trifecta.Combinators.MarkParsing d (Control.Monad.Trans.State.Strict.StateT s m)
instance (GHC.Internal.Base.MonadPlus m, Text.Trifecta.Combinators.MarkParsing d m) => Text.Trifecta.Combinators.MarkParsing d (Control.Monad.Trans.State.Lazy.StateT s m)
instance (GHC.Internal.Base.MonadPlus m, Text.Trifecta.Combinators.MarkParsing d m, GHC.Internal.Base.Monoid w) => Text.Trifecta.Combinators.MarkParsing d (Control.Monad.Trans.Writer.Lazy.WriterT w m)
instance (GHC.Internal.Base.MonadPlus m, Text.Trifecta.Combinators.MarkParsing d m, GHC.Internal.Base.Monoid w) => Text.Trifecta.Combinators.MarkParsing d (Control.Monad.Trans.Writer.Strict.WriterT w m)

module Text.Trifecta.Parser

-- | The type of a trifecta parser
--   
--   The first four arguments are behavior continuations:
--   
--   
--   
- epsilon success: the parser has consumed no input and has a result
--   as well as a possible Err; the position and chunk are unchanged (see
--   pure)
--   
- epsilon failure: the parser has consumed no input and is failing
--   with the given Err; the position and chunk are unchanged (see
--   empty)
--   
- committed success: the parser has consumed input and is yielding
--   the result, set of expected strings that would have permitted this
--   parse to continue, new position, and residual chunk to the
--   continuation.
--   
- committed failure: the parser has consumed input and is failing
--   with a given ErrInfo (user-facing error message)
--   
--   
--   The remaining two arguments are
--   
--   
--   
- the current position
--   
- the chunk of input currently under analysis
--   
--   
--   Parser is an Alternative; trifecta's backtracking
--   behavior encoded as <|> is to behave as the leftmost
--   parser which yields a value (regardless of any input being consumed)
--   or which consumes input and fails. That is, a choice of parsers will
--   only yield an epsilon failure if *all* parsers in the choice do. If
--   that is not the desired behavior, see try, which turns a
--   committed parser failure into an epsilon failure (at the cost of error
--   information).
newtype Parser a
Parser :: (forall r. () => (a -> Err -> It Rope r) -> (Err -> It Rope r) -> (a -> Set String -> Delta -> ByteString -> It Rope r) -> (ErrInfo -> It Rope r) -> Delta -> ByteString -> It Rope r) -> Parser a
[unparser] :: Parser a -> forall r. () => (a -> Err -> It Rope r) -> (Err -> It Rope r) -> (a -> Set String -> Delta -> ByteString -> It Rope r) -> (ErrInfo -> It Rope r) -> Delta -> ByteString -> It Rope r
manyAccum :: (a -> [a] -> [a]) -> Parser a -> Parser [a]

-- | A Step allows for incremental parsing, since the parser
--   
--   
--   
- can be done with a final result
--   
- have errored
--   
- can have yielded a partial result with possibly more to come
--   
data Step a

-- | Parsing is done and has converted the Rope to a final result
StepDone :: !Rope -> a -> Step a

-- | Parsing the Rope has failed with an error
StepFail :: !Rope -> ErrInfo -> Step a

-- | The Rope has been partially consumed and already yielded a
--   Result, and if more input is provided, more results can be
--   produced.
--   
--   One common scenario for this is to parse log files: after parsing a
--   single line, that data can already be worked with, but there may be
--   more lines to come.
StepCont :: !Rope -> Result a -> (Rope -> Step a) -> Step a

-- | Feed some additional input to a Step to continue parsing a bit
--   further.
feed :: Reducer t Rope => t -> Step r -> Step r

-- | Assume all possible input has been given to the parser, execute it to
--   yield a final result.
starve :: Step a -> Result a

-- | Incremental parsing. A Step can be supplied with new input
--   using feed, the final Result is obtained using
--   starve.
stepParser :: Parser a -> Delta -> Step a
stepResult :: Rope -> Result a -> Step a
stepIt :: It Rope a -> Step a

-- | Run a Parser on input that can be reduced to a Rope,
--   e.g. String, or ByteString. See also the monomorphic
--   versions parseString and parseByteString.
runParser :: Reducer t Rope => Parser a -> Delta -> t -> Result a

-- | (parseFromFile p filePath) runs a parser p on
--   the input read from filePath using readFile. All
--   diagnostic messages emitted over the course of the parse attempt are
--   shown to the user on the console.
--   
--   
--   main = do
--     result <- parseFromFile numbers "digits.txt"
--     case result of
--       Nothing -> return ()
--       Just a  -> print $ sum a
--   
parseFromFile :: MonadIO m => Parser a -> String -> m (Maybe a)

-- | (parseFromFileEx p filePath) runs a parser p
--   on the input read from filePath using readFile.
--   Returns all diagnostic messages emitted over the course of the parse
--   and the answer if the parse was successful.
--   
--   
--   main = do
--     result <- parseFromFileEx (many number) "digits.txt"
--     case result of
--       Failure xs -> displayLn xs
--       Success a  -> print (sum a)
--   
parseFromFileEx :: MonadIO m => Parser a -> String -> m (Result a)

-- | Fully parse a String to a Result.
--   
--   parseByteString p delta i runs a parser p on
--   i.
parseString :: Parser a -> Delta -> String -> Result a

-- | Fully parse a ByteString to a Result.
--   
--   parseByteString p delta i runs a parser p on
--   i.
parseByteString :: Parser a -> Delta -> ByteString -> Result a
parseTest :: (MonadIO m, Show a) => Parser a -> String -> m ()
instance GHC.Internal.Base.Alternative Text.Trifecta.Parser.Parser
instance GHC.Internal.Base.Applicative Text.Trifecta.Parser.Parser
instance Text.Parser.Char.CharParsing Text.Trifecta.Parser.Parser
instance Text.Trifecta.Combinators.DeltaParsing Text.Trifecta.Parser.Parser
instance Text.Trifecta.Result.Errable Text.Trifecta.Parser.Parser
instance GHC.Internal.Base.Functor Text.Trifecta.Parser.Parser
instance GHC.Internal.Base.Functor Text.Trifecta.Parser.Step
instance Text.Parser.LookAhead.LookAheadParsing Text.Trifecta.Parser.Parser
instance Text.Trifecta.Combinators.MarkParsing Text.Trifecta.Delta.Delta Text.Trifecta.Parser.Parser
instance GHC.Internal.Control.Monad.Fail.MonadFail Text.Trifecta.Parser.Parser
instance GHC.Internal.Base.Monad Text.Trifecta.Parser.Parser
instance GHC.Internal.Base.MonadPlus Text.Trifecta.Parser.Parser
instance (GHC.Internal.Base.Semigroup a, GHC.Internal.Base.Monoid a) => GHC.Internal.Base.Monoid (Text.Trifecta.Parser.Parser a)
instance Text.Parser.Combinators.Parsing Text.Trifecta.Parser.Parser
instance GHC.Internal.Base.Semigroup a => GHC.Internal.Base.Semigroup (Text.Trifecta.Parser.Parser a)
instance GHC.Internal.Show.Show a => GHC.Internal.Show.Show (Text.Trifecta.Parser.Step a)
instance Text.Parser.Token.TokenParsing Text.Trifecta.Parser.Parser

-- | For a short introduction, see the Text.Trifecta.Tutorial
--   module.
module Text.Trifecta

-- | This module provides a short introduction to get users started using
--   Trifecta. The key takeaway message is that it’s not harder, or even
--   much different, from using other parser libraries, so for users
--   familiar with one of the many Parsecs should feel right at home.
--   
--   The source of this file is written in a literate style, and can
--   be read top-to-bottom.
module Text.Trifecta.Tutorial

-- | First, we import Trifecta itself. It only the core parser definitions
--   and instances. Since Trifecta on its own is just the parser and a
--   handful of instances; the bulk of the utility functions is actually
--   from a separate package, parsers, that provides the usual
--   parsing functions like manyTill, between, and so on. The
--   idea behind the parsers package is that most parser libraries
--   define the same generic functions, so they were put into their own
--   package to be shared. Trifecta reexports these definitions, but it’s
--   useful to keep in mind that the documentation of certain functions
--   might not be directly in the trifecta package.
importDocumentation :: docDummy

-- | In order to keep things minimal, we define a very simple language for
--   arithmetic expressions.
data Expr

-- | expr + expr
Add :: Expr -> Expr -> Expr

-- | 1, 2, -345, …
Lit :: Integer -> Expr

-- | The parser is straightforward: there are literal integers, and
--   parenthesized additions. We require parentheses in order to keep the
--   example super simple as to not worry about operator precedence.
--   
--   It is useful to use tokenizing functions to write parsers.
--   Roughly speaking, these automatically skip trailing whitespace on
--   their own, so that the parser isn’t cluttered with
--   skipWhitespace calls. symbolic for example parses a
--   Char and then skips trailing whitespace; there is also the more
--   primitive char function that just parses its argument and
--   nothing else.
parseExpr :: Parser Expr

-- | We can now use our parser to convert a String to an
--   Expr,
--   
--   
--   parseString parseExpr mempty "(1 + (2 + 3))"
--   
--   
--   
--   Success (Add (Lit 1) (Add (Lit 2) (Lit 3)))
--   
--   
--   When we provide ill-formed input, we get a nice error message with an
--   arrow to the location where the error occurred:
--   
--   
--   parseString parseExpr mempty "(1 + 2 + 3))"
--   
--   
--   
--   (interactive):1:8: error: expected: ")"
--   1 | (1 + 2 + 3))<EOF>
--     |        ^
--   
examples :: docDummy
instance GHC.Internal.Show.Show Text.Trifecta.Tutorial.Expr
