Karya, built on Mon Jul 24 11:39:07 PDT 2017 (patch 33511aca01257b76b88de7c7a2763b7a965c084e)

Safe HaskellNone

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 #

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 -> String 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.