ghci-history-parser-0.1.0.2: parse output of ghci ":history" command

Safe HaskellSafe-Inferred

GHCi.History.Parse.Common

Description

Grammar describing the output of ghci's :history command, usable by either Parsec or Text.ParserCombinators.ReadP.

Synopsis

Documentation

someSpace :: Parsing m => m ()Source

one or more space characters

num :: Parser IntSource

a number – one or more digits

negNum :: Parser IntSource

negNum := '-' <num>

numSpan :: Parser (Int, Int)Source

numSpan := <num> '-' <num>

filePos :: Parser FilePosSource

filePos := '(' <num> ',' <num> ')'

unabbrevPosRange :: Parser (FilePos, FilePos)Source

unabbrevPosRange := '(' <filePos> ')-(' <filePos> ')'

abbrevPosRange :: Parser (FilePos, FilePos)Source

abbrevPosRange :=  <num> ':' <num> '-' <num>

pointRange :: Parser (FilePos, FilePos)Source

pointRange :=  <num> ':' <num>

A point range – i.e., a range whose start point and end point are the same.

filename :: Parser StringSource

string representing a filename. Can't contain ":".

funcname :: Parser StringSource

discards terminal control codes

histLine :: Parser HistoryItemSource

histLine := <negNum> ':' <funcname> '(' <filename> ':' <posRange> ')'

emptyHistory :: Parser [HistoryItem]Source

An empty history starts with the string "Empty history".

nonEmptyHistory :: (Monad m, Parsing m) => m [HistoryItem]Source

A non-empty history: one or more histLines, followed by the string "<end of history>", or "..." if ghci has cut off remaining entries due to length.