Karya, built on 2022-03-21T01:30:44 (patch 89d1651424c35e564138d93424a157ff87457245)
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.