Karya, built on 2018-05-31T02:46:59 (patch 0a1a35479c514820d77330ae8a978975ba22a47a)

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.