h$?      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                                                                          ! Safe-Inferred 4 vgrep7 is an unbounded priority queue based on a Finger Tree.vgrep Build a new .vgrepIO version of ). This is useful for creating top-level TPQueues using unsafePerformIO, because using  inside unsafePerformIO isn't possible.vgrepWrite a value to a .vgrep#Read the next minimal value from a .vgrep A version of " that does not retry, but returns # instead if no value is available.vgrep"Get the next minimal value from a  without removing it.vgrep A version of " that does not retry, but returns # instead if no value is available.vgrepReturns  if the  is empty.   Safe-Inferred   !"#$%&'()*+,-./012345678:9;<=>?@ABCDEFGHJIOPQRSTUVWXYZ[\]^_`abedcfghijklmnopqrstuvwyx  !"#$%&'()*+,-./012345678:9;<=>?@ABCDEFGHJIOPQRSTUVWXYZ[\]^_`abedcfghijklmnopqrstuvwyx Safe-InferredKM|{ Safe-InferredEvgrepSpawn a mailbox to store prioritized messages in a Mailbox. Using  on the  will return  the minimal element, or  if the mailbox is closed.This function is analogous to Pipes.Concurrent. !  ", but it uses a  instead of a  to store messages.vgrep passes its enclosed action an  and  like you'd get from , but automatically seals them after the action completes. This can be used when you need the sealing behavior available from *, but want to work at a bit higher level: *withSpawn buffer $ \(output, input) -> ..." is exception-safe, since it uses  internally. ~ ~ None#vgrep#Type alias for Text formatted with  from  Graphics.Vty.vgrepA representattion of formatted . The attribute is usually a  so that different formattings can be combined by nesting them.vgrepAn empty blockvgrepA bare (unformatted) text nodevgrepAdds formatting to a blockvgrep-Concatenates several blocks of formatted textvgrepSmart constructor for an empty  text.vgrep.Smart constructor for bare (unformatted) text.bare ""Empty bare "Text" Text 4 "Text"vgrepAdds formatting to a  text. The  and  instances for attr+ are used to flatten redundant formattings./format (Just ()) (format Nothing (bare "Text"))"Format 4 (Just ()) (Text 4 "Text")1format (Just ()) (format (Just ()) (bare "Text"))"Format 4 (Just ()) (Text 4 "Text")format Nothing (bare "Text") Text 4 "Text"vgrepConcatenates pieces of  text. Redundant formattings and blocks of equal formatting are  d together.vgrep Simplifies  text by leaving out redundant empty bits, joining pieces of text with the same formatting, and flattening redundant applications of the same style.!emptyFormatted `fuse` bare "Text" Text 4 "Text"format (Just ()) (bare "Left") `fuse` format (Just ()) (bare "Right")'Format 9 (Just ()) (Text 9 "LeftRight")vgrep.Apply a function to each piece of text in the  tree.mapText T.toUpper (Cat 11 [Text 6 "Hello ", Format 5 () (Text 5 "World")])5Cat 11 [Text 6 "HELLO ",Format 5 () (Text 5 "WORLD")]vgrepLike , but passes the position of the text chunk to the function as well. Can be used for formatting text position-dependently, e.g. for expanding tabs to spaces.vgrepCrops the text to a given length. If the text is already shorter than the desired width, it is returned as-is.vgrepDrops a prefix of the given length. If the text is already shorter than the number of characters to be dropped,  is returned.vgrepPads the text to a given width. If the text is already longer than the desired width, it is returned as-is. None $vgrep*Directly parses ANSI formatted text using .Parsing ANSI color codes:&parseAnsi "Hello \ESC[31mWorld\ESC[m!"Cat 12 [Text 6 "Hello ",Format 5 (Attr {attrStyle = KeepCurrent, attrForeColor = SetTo (ISOColor 1), attrBackColor = KeepCurrent, attrURL = KeepCurrent}) (Text 5 "World"),Text 1 "!"]More elaborate example with nested foreground and background colors:6parseAnsi "\ESC[m\ESC[40mHello \ESC[31mWorld\ESC[39m!"Cat 12 [Format 6 (Attr {attrStyle = KeepCurrent, attrForeColor = KeepCurrent, attrBackColor = SetTo (ISOColor 0), attrURL = KeepCurrent}) (Text 6 "Hello "),Format 5 (Attr {attrStyle = KeepCurrent, attrForeColor = SetTo (ISOColor 1), attrBackColor = SetTo (ISOColor 0), attrURL = KeepCurrent}) (Text 5 "World"),Format 1 (Attr {attrStyle = KeepCurrent, attrForeColor = KeepCurrent, attrBackColor = SetTo (ISOColor 0), attrURL = KeepCurrent}) (Text 1 "!")]Some CSI sequences are ignored, since they are not supported by Vty:3parseAnsi "\ESC[A\ESC[B\ESC[31mfoo\ESC[1K\ESC[mbar"Cat 6 [Format 3 (Attr {attrStyle = KeepCurrent, attrForeColor = SetTo (ISOColor 1), attrBackColor = KeepCurrent, attrURL = KeepCurrent}) (Text 3 "foo"),Text 3 "bar"]=Non-CSI sequences are not parsed, but included in the output:+parseAnsi "\ESC]710;font\007foo\ESC[31mbar"Cat 17 [Text 14 "\ESC]710;font\afoo",Format 3 (Attr {attrStyle = KeepCurrent, attrForeColor = SetTo (ISOColor 1), attrBackColor = KeepCurrent, attrURL = KeepCurrent}) (Text 3 "bar")]vgrepParser for ANSI formatted text. Recognized escape sequences are the SGR (Select Graphic Rendition) sequences (ESC[@m) supported by =. Unsupported SGR sequences and other CSI escape sequences (ESC[@) are ignored. Other (non-CSI) escape sequences are not parsed, and included in the output.This parser does not fail, it will rather consume and return the remaining input as unformatted text.vgrepParser for ANSI CSI escape sequences. Recognized escape sequences are the SGR (Select Graphic Rendition) sequences (ESC[@m) supported by =. Unsupported SGR sequences and other CSI escape sequences (ESC[@) are ignored by returning .This parser fails when encountering any other (non-CSI) escape sequence. Safe-Inferred%Xvgrep Combines two s. This differs from  from the  instance of  in that #$(s are combined rather than overwritten. None'\vgrep#Converts ANSI formatted text to an (. Nested formattings are combined with  . The given ' is used as style for the root of the  tree. rJust (KeybindingMap {unKeybindingMap = fromList [(Chord (fromList []) Up,ResultsUp),(Chord (fromList []) Down,ResultsDown)]})r <> lJust (KeybindingMap {unKeybindingMap = fromList [(Chord (fromList []) Up,ResultsUp),(Chord (fromList []) Down,PagerDown)]})In particular,  (&( []), (declaring an empty list of mappings) and  (not declaring anything) are equivalent, given that there are already default mappings:7l <> Just (KeybindingMap (fromList [])) == l <> NothingTrueThis means that new keybindings override the previous ones if they collide, otherwise they are simply added. To remove a keybinding, it has to be mapped to Unset explicitly.vgrepA  for reading partial ) configurations.8Note that the attributes are not merged, but overridden:import Graphics.Vty.Attributes-let leftStyle = defAttr `withStyle` standout.let rightStyle = defAttr `withForeColor` black3let l = mempty { _mnormal = First (Just leftStyle)}4let r = mempty { _mnormal = First (Just rightStyle)};_mnormal (l <> r) == First (Just (leftStyle <> rightStyle))False+_mnormal (l <> r) == First (Just leftStyle)TruevgrepA " for reading partial configs. The  can be converted to an actual * using +.The Monoid consists mostly of 'First a' values, so the most important config (the one that overrides all the others) should be read first.None #$8>DIvgrepA JSON-parsable data type for .decodeEither' "[\"standout\", \"underline\", \"bold\"]" :: Either ParseException [Style]Right [Standout,Underline,Bold]Also works without quotes:decodeEither' "[standout, underline, bold]" :: Either ParseException [Style]Right [Standout,Underline,Bold] Fails with error message if the  cannot be parsed:;isLeft (decodeEither' "foo" :: Either ParseException Color)TruevgrepA JSON-parsable data type for .decodeEither' "[\"black\",\"red\",\"bright-black\"]" :: Either ParseException [Color]Right [Black,Red,BrightBlack]Also works without quotes:decodeEither' "[black,red,bright-black]" :: Either ParseException [Color]Right [Black,Red,BrightBlack] Fails with error message if the  cannot be parsed:;isLeft (decodeEither' "foo" :: Either ParseException Color)TruevgrepA JSON-parsable data type for . JSON example:decodeEither' "{\"fore-color\": \"black\", \"style\": \"standout\"}" :: Either ParseException AttrRight (Attr {foreColor = Just Black, backColor = Nothing, style = Just Standout})JSON example without quotes: >>> decodeEither' "{fore-color: black, style: standout}" :: Either ParseException Attr Right (Attr {foreColor = Just Black, backColor = Nothing, style = Just Standout}) YAML example::{ decodeEither'$ "fore-color: \"blue\"\n""<> "back-color: \"bright-blue\"\n"<> "style: \"reverse-video\"\n":: Either ParseException Attr:}Right (Attr {foreColor = Just Blue, backColor = Just BrightBlue, style = Just ReverseVideo})YAML example without quotes::{ decodeEither'$ "fore-color: blue\n"<> "back-color: bright-blue\n"<> "style: reverse-video\n":: Either ParseException Attr:}Right (Attr {foreColor = Just Blue, backColor = Just BrightBlue, style = Just ReverseVideo})4An empty JSON/YAML object yields the default colors:0decodeEither' "{}" :: Either ParseException AttrRight (Attr {foreColor = Nothing, backColor = Nothing, style = Nothing})vgrepReads the configuration from a JSON or YAML file. The file should be located in one of the following places:~/.vgrep/config.yaml,~/.vgrep/config.yml,~/.vgrep/config.json or~/.vgrep/config.When none of these files exist, no error is raised. When a file exists, but cannot be parsed, a warning is written to stderr.Supported formats are JSON and YAML. The example YAML config given in the project directory (config.yaml.example&) is equivalent to the default config:.import qualified Vgrep.Environment.Config as CRight config <- decodeFileEither "config.yaml.example" :: IO (Either ParseException ConfigMonoid),C.fromConfigMonoid config == C.defaultConfigTrueExample YAML config file for ,: colors: line-numbers: fore-color: blue line-numbers-hl: fore-color: blue style: bold normal: {} normal-hl: style: bold file-headers: back-color: green selected: style: standout tabstop: 8 editor: "vi"&Example JSON file for the same config: { "colors": { "line-numbers" : { "fore-color": "blue" }, "line-numbers-hl": { "fore-color": "blue", "style": "bold" }, "normal": {}, "normal-hl": { "style": "bold" }, "file-headers": { "back-color": "green" }, "selected": { "style": "standout" } }, "tabstop": 8, "editor": "vi" }/The JSON/YAML keys correspond to the lenses in Vgrep.Environment.Config, the values for  and  can be obtained from the corresponding predefined constants in Graphics.Vty.Attributes.NoneDvgrepDetermines the  value for - ( ) from the environment variable $EDITOR..NoneENone#$JPvgrep3Keybindings in effect when results list is focused.vgrep,Keybindings in effect when pager is focused.vgrepGlobal keybindings are in effect both for pager and results list, but can be overridden by either one.vgrepLine numbers (default: blue)vgrep-Highlighted line numbers (default: bold blue)vgrep'Normal text (default: terminal default)vgrep Highlighted text (default: bold)vgrepFile names in results view (default: terminal default color on green background)vgrep4Selected entry (default: terminal default, inverted)vgrepColor configurationvgrepTabstop width (default: 8)vgrepExecutable for e$ key (default: environment variable $EDITOR, or vi if $EDITOR is not set)vgrep Convert a  to a  . Missing () values in the  are supplied from the .vgrep Convert a  to a  config.vgrepGathers $s from various sources and builds a  based on the :!Config from environment variables.The configuration specified in the config file'External config, e.g. from command line0where the latter ones override the earlier ones.vgrep!External config from command line((NoneLOvgrep4The bounds (width and height) of a display viewport.vgrep/' actions can read from the environment.vgrep5External configuration (colors, editor executable, @)vgrepThe bounds (width and height) of the display viewport where the 0 or the current 12 is displayed6NoneP vgrepSuspend the application and run the action, e. g. invoking an external process, then resume the application.vgrep Shut down.vgrepIndicates that the state has been changed visibly, so the screen should be refreshed.vgrepThe state has not changed or the change would not be visible, so refreshing the screen is not required.vgrep/The type of action to be performed on an event.vgrep>Do not handle the event (fall-through to other event handlers)vgrep(Handle the event by performing an actionvgrepInterrupt the applicationvgrepIf the lookup returns  action, then handle it with  action' , otherwise  this event handler.vgrepSpecial case of ( where actions are looked up from a map.vgrep=The first event handler that triggers (i. e. does not return ) handles the event.NonePNoneVvgrepParses lines of $, skipping lines that are not valid grep output.vgrepParses a line of grep output. Returns  if the line cannot be parsed.The output should consist of a file name, line number and the content, separated by colons:#parseLine "path/to/file:123:foobar"Just (FileLineReference {_file = File {_fileName = "path/to/file"}, _lineReference = LineReference {_lineNumber = Just 123, _lineText = Text 6 "foobar"}})5Omitting the line number still produces valid output:parseLine "path/to/file:foobar"Just (FileLineReference {_file = File {_fileName = "path/to/file"}, _lineReference = LineReference {_lineNumber = Nothing, _lineText = Text 6 "foobar"}})&However, an file name must be present:parseLine "foobar"Nothing8ANSI escape codes in the line text are parsed correctly:0parseLine "path/to/file:foo\ESC[31mbar\ESC[mbaz"Just (FileLineReference {_file = File {_fileName = "path/to/file"}, _lineReference = LineReference {_lineNumber = Nothing, _lineText = Cat 9 [Text 3 "foo",Format 3 (Attr {attrStyle = KeepCurrent, attrForeColor = SetTo (ISOColor 1), attrBackColor = KeepCurrent, attrURL = KeepCurrent}) (Text 3 "bar"),Text 3 "baz"]}})NoneYvgrepLike , but if the input is not prefixed with a file and line number, i. e. is not valid grep -nH output, then adds -nH (-n: with line number, -H: with file name) to the grep command line arguments.vgrepTakes a  stream and runs it through a grep process, returning a stream of results. The original command line arguments are passed to the process.vgrepInvokes  grep -nH -rI (-n: with line number, -H: with file name, -r : recursive, -I: ignore binary files) and returns the results as a stream. More arguments (e. g. pattern and directory) are taken from the command line.None?YvgrepExpand a list of linesvgrepExpand a single linevgrepExpand an ANSI formatted lineNone>?\vgrepThe 3 monad transformer is parameterized over the state s of a 12 or an 30.vgrepLift a monadic action to .vgrepPass an initial state and an  and reduce a ( action to an action in the base monad.vgrep A version of  where the action is lifted to .vgrepThe  of  is not stateful, however it can be modified globally. An example is resizing the application by changing the display bounds.vgrep can read from the . Modifications to the enviromnent are only possible globally (see ), the N environment is pure.KL}NM|{zzKL}NM|{Noneavgrep% events do have higher priority than  events, so that the application stays responsive even in case of event queue congestion.vgrepWe need the viewport in order to initialize the app, which in turn will start 5. To resolve this circular dependency, we start once  in order to determine the display viewport, and shut it down again immediately.vgrep7Spawns a thread parallel to the action that listens to # events and redirects them to the .vgrep Passes a  instance to the action and shuts it down properly after the action finishes. The  and  handles are connected to /dev/tty (see ).vgrepLike , but lifted to  s .vgrep9Passes two file descriptors for read and write access to /dev/tty? to the action, and closes them after the action has finished.vgrepLike , but lifted to  s .vgrepOpens /dev/tty0 in Read/Write mode. Should be connected to the stdin and stdout of a GUI process (e. g. ).  Nonef7vgrepThe % type is parameterized over the type e$ of events it handles and the type s of its state.vgrep&Creates the initial state for the app.vgrepHow to convert an external  to the App's eventvgrep5Handles an event, possibly modifying the App's state.  handleEvent e s = case e of   [] ->  ( ) -- Handles the Enter key, but does nothing.   [] ->  ( ) -- Handles the Up8 key and triggers a redraw. _otherwise ->  -- Does not handle the event, so other handlers may be invoked. vgrep Creates a  to be displayed. May modify the App's state (e. g. for resizing).vgrepLike &, but does not return the final state.vgrep"Runs runs the event loop until an  & is encountered. Events handled with  ( action) will shut down , run the action (e. g. invoking an external editor), and start  again.NoneivgrepThe internal state of the split-view widget. Tracks the state of both child widgets and the current layout.vgrepState of the left widgetvgrepState of the right widgetvgrepCurrent layoutvgrep"The currently focused child widgetview currentWidget $ HSplit { _leftWidget = "foo", _layout = LeftOnly } Left "foo"vgrep$Traverses the left widget if focused5has leftWidgetFocused $ HSplit { _layout = LeftOnly }True6has leftWidgetFocused $ HSplit { _layout = RightOnly }Falsehas leftWidgetFocused $ HSplit { _layout = Split FocusLeft (1 % 2) }Truevgrep%Traverses the right widget if focused7has rightWidgetFocused $ HSplit { _layout = RightOnly }True6has rightWidgetFocused $ HSplit { _layout = LeftOnly }Falsehas rightWidgetFocused $ HSplit { _layout = Split FocusRight (1 % 2) }TrueNonekvgrepKeeps track of the lines of text to display, the current scroll positions, and the set of highlighted line numbers.vgrep2The current column offset for horizontal scrollingvgrepSet of line numbers that are highlighted (i.e. they contain matches)vgrepZipper: Lines above the screenvgrep!Zipper: Lines on screen and belowvgrep.The number of invisible lines above the screen  Nonesvgrep.Ad-hoc data structure to render the (visible)  as list of lines.vgrepResults widget statevgrepThe results list is emptyvgrep7The structure of the Results buffer is a double Zipper:lines above the current screen&lines on screen above the current itemthe current item&lines on screen below the current itemlines below the current screenvgrepAppend a line to the 9. The line is appended below the visible screen, so use  to make it visible.vgrep?@45(ABCABDABEABFABGABHABIABJABKABLABMABNABOABPABQABRABSABTABUABVABWABXABYABZAB[AB\AB]AB^AB_AB`ABaABbABcABdABeABfABgABhABiABjAklAkmAknAkoAkpAkqAkrAksAktAkuAkvAkwAkxAyzAy{Ay|Ay}Ay~AyAyAyAyAyAy                                                                                                  ($%%))**-+,/0022777777777777777777777777777777777777777777:7<77777777>>>>?>>>>>>>>>>77777$7#7$vgrep-0.2.3.0-79CAs1b54BVGsHizAm4Sjp Vgrep.Event%Vgrep.Widget.HorizontalSplit.InternalControl.Lens.Compat Vgrep.TypePipes.Concurrent.PQueueVgrep.Ansi.Vty.AttributesControl.Concurrent.STM.TPQueueControl.Monad.State.ExtendedVgrep.Ansi.TypeVgrep.Ansi.Parser Vgrep.Ansi Vgrep.Command Vgrep.KeyVgrep.KeybindingMapVgrep.Environment.Config.Monoid%Vgrep.Environment.Config.Sources.File$Vgrep.Environment.Config.Sources.EnvVgrep.Environment.ConfigVgrep.Environment Vgrep.Results Vgrep.ParserVgrep.System.Grep Vgrep.TextVgrep.App.Internal Vgrep.AppVgrep.Widget.Pager.InternalVgrep.Widget.Results.InternalVgrep.Widget.TypeVgrep.Widget.ResultsVgrep.Widget.PagerVgrep.Widget.HorizontalSplitPipes.Concurrentspawn' UnboundedVtyStyle KeybindingsData.Map.StrictunionfromListColorsConfigfromConfigMonoid defaultConfig_editor Vgrep.Environment.Config.SourcesVgrepTApp Vgrep.WidgetWidget Vgepr.Appcontainers-0.6.2.1Data.Map.InternalMapbaseGHC.Real% Data.Function& Data.Functor<&>transformers-0.5.6.2Control.Monad.Trans.Classlift)microlens-0.4.11.2-9caS3Frz8K54yIHXMtlddL Lens.Micro_Nothing_Just_Right_Left mapAccumLOf_last_init_tail_headbothfilteredfailingsingularforOfnonlensfoldinghasforOf_ traverseOf_^?!^?toListOf^..to^. transformOf rewriteOf<<.~<<%~<%~mapped?~set.~<>~-~+~over%~Lens.Micro.Internalsetsfolded traversedeachixat_1_2_3_4_5lazystrictLens.Micro.TypeASetterASetter' SimpleGetterGetting SimpleFoldLensLens' Traversal Traversal'LensLike LensLike'+microlens-ghc-0.4.12-1AbATKxQMzZ7ILqBaxTA8lLens.Micro.GHC.Internalchars unpackedChars packedChars unpackedBytes packedBytes mtl-2.2.2Control.Monad.State.ClassmodifyControl.Monad.Reader.Class MonadReader MonadStatelocal,microlens-mtl-0.2.0.1-FlMoivBDWtKHCkgnYbvjN0Lens.Micro.Mtl>=>>Functorfmap<$Control.Monad.FixMonadFixmfixControl.Monad.Fail MonadFailfailData.TraversablemapMsequence MonadPlusmzeromplusControl.Monad.IO.ClassMonadIOliftIOmfilter<$!>unless replicateM_ replicateMfoldM_foldM zipWithM_zipWithM mapAndUnzipMforever<=<>=>filterMforM Data.Foldablemsum sequence_forM_mapM_fixvoidapliftM5liftM4liftM3liftM2liftMwhen=<< Control.Monad.Trans.State.StrictStateT runStateT MonadTransgetsstatemodify'StaterunState evalState execStatemapState withState evalStateT execStateT mapStateT withStateTJust stm-2.5.0.0Control.Concurrent.STM.TQueueTQueueControl.Exception.BasebracketMonoid GHC.ClassesEqidmappendGraphics.Vty.Image.InternalImage text-1.2.3.2Data.Text.InternalGraphics.Vty.Input.EventsEventGraphics.Vty.Attributes.Colormempty Graphics.Vty#pipes-4.3.14-LO733KrDf1fJXNepPaOWnk Pipes.CoreConsumerGraphics.Vty.ConfiginputFdoutputFdIOEvKeyKEnterpureKUpGraphics.Vty.PicturePicture