Karya, built on 2018-03-16T03:22:32 (patch df7306861219887e676081746f4a4edfe05eb0b5)

Safe HaskellNone




Like Util.ParseBs, but for parsec, not attoparsec. I only use attoparsec when performance matters, because its error msgs are crummy.



type Parser st a = P.Parsec Text st a Source #

parse :: Parser () a -> Text -> Either Text a Source #

file :: a -> Parser st a -> st -> FilePath -> IO (Either Error.ParseError a) Source #

Try to parse a file, or return a default value if the file doesn't exist.

format1 :: Text -> Error.ParseError -> Text Source #

Format a ParseError assuming the input is just one line.

text :: Text -> Parser st () Source #

Like string, but for text. Apparently there's no way to do this without converting to String first.

p_nat :: Parser st Int Source #

Natural number including 0.

p_positive :: Parser st Int Source #

Natural number without 0.