Karya, built on 2020-11-26T21:03:17 (patch 23b5be2d53a9e8e7d6136cda5aae2849abe5cded)
Safe HaskellNone

Util.Parse

Contents

Description

Generic parsing utils.

Synopsis

parsec

parseM :: Monad m => FilePath -> ParserT m a -> Text -> m (Either Text a) Source #

parseS :: state -> FilePath -> ParserS state a -> Text -> Either Text a Source #

file :: a -> ParserS st a -> st -> FilePath -> IO (Either Text a) Source #

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

p_nat :: ParserT m Int Source #

Natural number including 0.

p_positive :: ParserT m Int Source #

Natural number without 0.