Karya, built on 2023-08-29T07:47:28 (patch 7a412d5d6ba4968ca4155ef276a062ccdeb9109a)
Safe HaskellSafe-Inferred

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.