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

Util.Parse

Contents

Description

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

Synopsis

parsec

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.

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.

Natural number including 0.

Natural number without 0.