ajhc-0.8.0.7: Haskell compiler that produce binary through C language

Portabilityportable
Stabilityexperimental
Maintainerlibraries@haskell.org
Safe HaskellNone

FrontEnd.ParseMonad

Contents

Description

Monads for the Haskell parser and lexer.

Synopsis

Parsing

data P a Source

Monad for parsing

data ParseResult a Source

The result of a parse.

Constructors

ParseOk a

The parse succeeded, yielding a value and a set of warnings.

ParseFailed SrcLoc String

The parse failed at the specified source location, with an error message.

atSrcLoc :: P a -> SrcLoc -> P aSource

data ParseMode Source

Static parameters governing a parse. More to come later, e.g. literate mode, language extensions.

Constructors

ParseMode 

Fields

parseFilename :: FilePath

original name of the file being parsed

parseOpt :: Opt
 
parseFFI :: Bool
 
parseUnboxedValues :: Bool
 
parseUnboxedTuples :: Bool
 

thenP :: P a -> (a -> P b) -> P bSource

returnP :: a -> P aSource

Lexing

data Lex r a Source

Instances

discard :: Int -> Lex r ()Source

Discard some input characters (these must not include tabs or newlines).

lexNewline :: Lex a ()Source

Discard the next character, which must be a newline.

lexTab :: Lex a ()Source

Discard the next character, which must be a tab.

alternative :: Lex a v -> Lex a (Lex a v)Source