Îõ³h$-,+Ö      !"#$%&'()*+,-./0123456789:;<=>?@A (c) 2020 compMITonecomputer00@gmail.comstableportable Safe-Inferred>Àherrata4A class for manipulating and converting source text.For  ByteStringã source types, you should convert it to one of the built-in instances with your encoding of choice.Every Source must be a B to allow for a CÕ which will be used as a source line when a pointer references an out-of-bounds line.errataSplits the source into lines.errataConverts the source text to À (strict). The given source text is a single line of the source. (c) 2020 compMITonecomputer00@gmail.comstableportable Safe-Inferred#errata8Stylization options for a block, e.g. characters to use.errata:Shows the location of a block at a file, line, and column.8This is put on its own line just above the source lines. errataShows the line number n for a source line.6The result should visually be the same length as just show n. errataStylize a source line.°Column pointers of the text that are being underlined are given for highlighting purposes. The result of this should visually take up the same space as the original line. errataÚThe text to use as an ellipsis in the position of line numbers for when lines are omitted.&This should visually be one character. errata#The prefix before the source lines.?Before it may be the line number, and after it the source line. errata/The text to underline a character in a pointer.&This should visually be one character.errata;The text to use as a vertical bar when connecting pointers.&This should visually be one character.errata=The text to use as a horizontal bar when connecting pointers.&This should visually be one character.errataÑThe text to use as a connector downwards and rightwards when connecting pointers.&This should visually be one character.errataÏThe text to use as a connector upwards and rightwards when connecting pointers.&This should visually be one character.errataÛThe text to use as a connector upwards, downwards, and rightwards when connecting pointers.&This should visually be one character.erratañA pointer is the span of the source code at a line, from one column to another. Each of the positions start at 1.9A pointer may also have a label that will display inline.ÐA pointer may also be connected to all the other pointers within the same block.errataThe line of the pointer.errata#The starting column of the pointer.errata!The ending column of the pointer.errata2Whether this pointer connects with other pointers.errata"An optional label for the pointer.errataÌInformation about a block in the source code, such as pointers and messages.*Each block has a style associated with it.errataThe style of the block.errata>The filepath, line, and column of the block. These start at 1.:This is used to create the text that details the location.errata!The header message for the block.?This will appear below the location and above the source lines.errataÛThe block's pointers. These are used to "point out" parts of the source code in this block.‹The locations of each of these pointers must be non-overlapping. If the pointers are touching at a boundary however, that is allowed. errataThe body message for the block.(This will appear below the source lines.!errata9A collection of information for pretty printing an error.#errata.The message that appears above all the blocks.$errata%Blocks in the source code to display.%errata.The message that appears below all the blocks.&errata.Label text. Generally goes inline with things.'errata'Body text. Generally goes below things.(errata)Header text. Generally goes above things.)errataColumn number, starts at 1.*errataLine number, starts at 1.+errataGets the column span for a .,errataØAdds highlighting to spans of text by enclosing it with some text e.g ANSI escape codes.,errataText to add before.errataText to add after.errataÑIndices to enclose. These are column spans, starting at 1. They must not overlap.errataText to highlight.'  !"#$%&'()*+,'*)('&!"#$% + , (c) 2020 compMITonecomputer00@gmail.comstableportable Safe-Inferred #$&ÙáŒ/errataRenders a collection of !.0errata9Group the pointers of a block by the line they appear on.1errataÀCreate a source table from the given line span and source lines.2errataÙTurns a list into a list of tail slices of the original list, with each element at index i dropping the first i- elements of the original list and tailing a C.ÂThis allows for correct behavior on out-of-source-bounds pointers.3errataRenders a single !.4errataRenders a single block.5errata%Renders the source lines for a block.3errataThe source table.errataThe ! to render.errata+The pointers of each block grouped by line.errataThe mininum line of each block.errataThe maxinum line of each block.4errataThe source table.errataThe block to render.errata+The pointers of this block grouped by line.errata,The mininum and maximum lines of this block.5errataÊThe source lines, from the minimum line to the maximum line for the block.errataThe block to render.errata4The length of the actual number of the maximum line.errata+The pointers of this block grouped by line./012345/345021 (c) 2020 compMITonecomputer00@gmail.comstableportable Safe-Inferred +z 6errataÐCreates a simple error that has a single block, with an optional header or body.7errataàA simple block that points to only one line and optionally has a label, header, or body message.8errata A variant of 7 that only points at one column.9errataÔA block that points to two parts of the source that are visually connected together.:errata A variant of 9- where the pointers point at only one column.;errataÔA block that points to two parts of the source that are visually connected together.ßIf the two parts of the source happen to be on the same line, the pointers are merged into one.<errata A variant of ;- where the pointers point at only one column.=errata*A basic style using only ASCII characters.Errors should look like so: Ûerror header message --> file.ext:1:16 block header message | 1 | line 1 foo bar do | ________________^^ start label 2 | | line 2 | | ^ unconnected label 3 | | line 3 . | |______^ middle label 6 | | line 6 7 | | line 7 baz end | |______^_____^^^ end label | | | | inner label block body message error body message>errata'A fancy style using Unicode characters.Errors should look like so: Ùerror header message ’C file.ext:1:16 block header message ‚J 1 ‚J line 1 foo bar do ‚J ŒJ€J€J€J€J€J€J€J€J€J€J€J€J€J€J€J€J^^ start label 2 ‚J ‚J line 2 ‚J ‚J ^ unconnected label 3 ‚J ‚J line 3 . ‚J œJ€J€J€J€J€J€J^ middle label 6 ‚J ‚J line 6 7 ‚J ‚J line 7 baz end ‚J ”J€J€J€J€J€J€J^€J€J€J€J€J^^^ end label ‚J ‚J ‚J ”J inner label block body message error body message?errataÃA fancy style using Unicode characters and ANSI colors, similar to >. Most things are colored red.@errataÃA fancy style using Unicode characters and ANSI colors, similar to >!. Most things are colored yellow.Aerrata?Pretty prints errors. The original source is required. Returns ; (lazy). If the list is empty, an empty string is returned.%Suppose we had an error of this type: ±data ParseError = ParseError { peFile :: FilePath , peLine :: Int , peCol :: Int , peUnexpected :: T.Text , peExpected :: [T.Text] }3Then we can create a simple pretty printer like so: Úimport qualified Data.Text as T import qualified Data.Text.Lazy.IO as TL import Errata toErrata :: ParseError -> !8 toErrata (ParseError fp l c unexpected expected) = 6- (Just "an error occured!") (7 =´ fp (Just "error: invalid syntax") (l, c, c + T.length unexpected, Just "this one") (Just $ "unexpected " <> unexpected <> "\nexpected " <> T.intercalate ", " expected)) Nothing printErrors :: T.Text -> [ParseError] -> IO () printErrors source es = TL.putStrLn $ A source (map toErrata es) (Note that in the above example, we have OverloadedStrings enabled to reduce uses of .,An example error message from this might be: ³an error occured! --> ./comma.json:2:18 error: invalid syntax | 2 | "bad": [1, 2,] | ^ this one unexpected ] expected null, true, false, ", -, digit, [, {6errata The header.errata The block.errata The body.7errataThe style of the pointer.errata The filepath.errataThe header message.errataThe second line number and column, starting at 1, and a label.errataThe body message.;errataThe style of the pointer.errata The filepath.errataThe header message.errataÂThe first line number and column span, starting at 1, and a label.errataÃThe second line number and column span, starting at 1, and a label.errata8The label for when the two pointers are merged into one.errataThe body message.<errataThe style of the pointer.errata The filepath.errataThe header message.errata=The first line number and column, starting at 1, and a label.errata>The second line number and column, starting at 1, and a label.errata8The label for when the two pointers are merged into one.errataThe body message.,  !"#$%6789:;<=>?@A,!"#$%6 789:;< =>?@AÄ      !!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHFGIÊerrata-0.3.0.0-inplace Errata.Source Errata.TypesErrata.Internal.RenderErrata Data.TextTextData.Text.LazypackSource sourceToLines sourceToText $fSourceText $fSourceText0 $fSource[]Style styleLocation styleNumber styleLine styleEllipsisstyleLinePrefixstyleUnderline styleVerticalstyleHorizontalstyleDownRight styleUpRightstyleUpDownRightPointer pointerLinepointerColStart pointerColEndpointerConnect pointerLabelBlock blockStyle blockLocation blockHeader blockPointers blockBody errataHeader errataBlocks errataBodyLabelBodyHeaderColumnLinepointerColumns highlight $fShowPointer $fEqPointer renderErrorsgroupBlockPointersmakeSourceTableslices renderErrata renderBlockrenderSourceLines errataSimple blockSimple blockSimple'blockConnectedblockConnected' blockMerged blockMerged' basicStyle fancyStyle fancyRedStylefancyYellowStyle prettyErrorsbaseGHC.BaseMonoidmempty