hnock-0.4.0: A Nock interpreter.

Safe HaskellSafe
LanguageHaskell2010

Nock.Parse

Synopsis

Documentation

runParser :: Stream s Identity t => Parsec s u a -> u -> SourceName -> s -> Either ParseError a #

The most general way to run a parser over the Identity monad. runParser p state filePath input runs parser p on the input list of tokens input, obtained from source filePath with the initial user state st. The filePath is only used in error messages and may be the empty string. Returns either a ParseError (Left) or a value of type a (Right).

 parseFromFile p fname
   = do{ input <- readFile fname
       ; return (runParser p () fname input)
       }