-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A framework for extending Haskell's syntax via quick-and-dirty preprocessors -- -- This library provides a quick-and-dirty (but often effective) method -- for extending Haskell's syntax using a custom preprocessor. It parses -- Haskell into a bare-bones AST with just enough knowledge of the syntax -- to preserve nesting, and then allows transformations on the AST. -- -- See the package ixdopp -- (http://hackage.haskell.org/cgi-bin/hackage-scripts/package/ixdopp) -- for an example of how to do this. @package preprocessor-tools @version 0.1.3 module Language.Haskell.Preprocessor.Loc data Loc file :: Loc -> String line :: Loc -> Int col :: Loc -> Int initial :: String -> Loc bogus :: Loc isBogus :: Loc -> Bool class Advance a advance :: Advance a => Loc -> a -> Loc scrub :: Data a => a -> a class Locatable a getLoc :: Locatable a => a -> Loc setLoc :: Locatable a => a -> Loc -> a cloneLoc :: Locatable a => a -> a -> a toDirective :: Loc -> String fromDirective :: String -> Maybe Loc toSourcePos :: Loc -> SourcePos fromSourcePos :: SourcePos -> Loc instance Typeable Loc instance Eq Loc instance Ord Loc instance Data Loc instance Show Loc instance (Locatable a, Locatable b) => Locatable (Either a b) instance Locatable a => Locatable [a] instance Locatable a => Locatable (Maybe a) instance Locatable Loc instance Advance a => Advance [a] instance Advance Char module Language.Haskell.Preprocessor.Error data Error Error :: Loc -> String -> Error loc :: Error -> Loc msg :: Error -> String fromParseError :: ParseError -> Error errorAt :: Locatable a => a -> String -> b instance Typeable Error instance Data Error instance Show Error module Language.Haskell.Preprocessor.Token data Token Token :: Tag -> [Token] -> Loc -> String -> Token tag :: Token -> Tag com :: Token -> [Token] loc :: Token -> Loc val :: Token -> String data Tag CPragma :: Tag Variable :: Tag Constructor :: Tag Operator :: Tag Other :: Tag CharLit :: Tag StringLit :: Tag IntLit :: Tag FloatLit :: Tag VIndent :: Tag VDedent :: Tag VSemi :: Tag Comment :: Tag Error :: Tag newToken :: Token instance Typeable Tag instance Typeable Token instance Eq Tag instance Show Tag instance Data Tag instance Eq Token instance Data Token instance Locatable Token instance Show Token module Language.Haskell.Preprocessor.SynSpec data SynSpec SynSpec :: Bool -> Bool -> Bool -> [[Keyword]] -> SynSpec unboxed :: SynSpec -> Bool pragmas :: SynSpec -> Bool levelnest :: SynSpec -> Bool blocks :: SynSpec -> [[Keyword]] data Keyword I :: String -> Keyword getKey :: Keyword -> String P :: String -> Keyword getKey :: Keyword -> String pair :: String -> String -> [Keyword] defaultSpec :: SynSpec instance Eq Keyword instance Show Keyword instance Eq SynSpec instance Show SynSpec instance Monoid SynSpec module Language.Haskell.Preprocessor.Ast data Ast Single :: Token -> Ast item :: Ast -> Token Block :: Token -> Maybe Token -> [Ast] -> Maybe Token -> Ast -> Ast item :: Ast -> Token lbrace :: Ast -> Maybe Token body :: Ast -> [Ast] rbrace :: Ast -> Maybe Token next :: Ast -> Ast Empty :: Ast flatten :: Ast -> [Token] -> [Token] flattenList :: [Ast] -> [Token] -> [Token] format :: Data a => a -> [Ast] -> a cons :: Token -> Ast -> Ast instance Typeable Ast instance Eq Ast instance Show Ast instance Data Ast instance Locatable Ast module Language.Haskell.Preprocessor.Parser quasi :: String -> [Ast] -> [Ast] quasiBy :: SynSpec -> String -> [Ast] -> [Ast] parse :: String -> String -> Either Error [Ast] parseBy :: SynSpec -> String -> String -> Either Error [Ast] parseTokens :: [Token] -> Either Error [Ast] parseTokensBy :: SynSpec -> [Token] -> Either Error [Ast] instance Eq Rule instance Show Rule module Language.Haskell.Preprocessor.Printer dump :: Monad m => (String -> m ()) -> [Ast] -> m () module Language.Haskell.Preprocessor.Util parens :: [Ast] -> Ast noParens :: [Ast] -> Ast splitVal :: String -> [Ast] -> Maybe ([Ast], Ast, [Ast]) splitTag :: Tag -> [Ast] -> Maybe ([Ast], Ast, [Ast]) splitSemis :: [Ast] -> [[Ast]] splitAllBy :: (Ast -> Bool) -> [Ast] -> [[Ast]] splitBy :: (Ast -> Bool) -> [Ast] -> Maybe ([Ast], Ast, [Ast]) valIs :: String -> Ast -> Bool tagIs :: Tag -> Ast -> Bool module Language.Haskell.Preprocessor class Locatable a getLoc :: Locatable a => a -> Loc setLoc :: Locatable a => a -> Loc -> a cloneLoc :: Locatable a => a -> a -> a scrub :: Data a => a -> a data Extension Extension :: [[Keyword]] -> ([Ast] -> [Ast]) -> SynSpec -> Maybe (IO ()) -> Maybe (Error -> IO ()) -> Extension keywords :: Extension -> [[Keyword]] transformer :: Extension -> [Ast] -> [Ast] synspec :: Extension -> SynSpec usage :: Extension -> Maybe (IO ()) syntaxerror :: Extension -> Maybe (Error -> IO ()) base :: Extension transform :: Extension -> [String] -> IO () hLoad :: SynSpec -> String -> Handle -> IO (Either Error [Ast]) fileLoad :: SynSpec -> String -> FilePath -> IO (Either Error [Ast]) stdinLoad :: SynSpec -> IO (Either Error [Ast]) hDump :: SynSpec -> Handle -> [Ast] -> IO () fileDump :: SynSpec -> String -> [Ast] -> IO () stdoutDump :: SynSpec -> [Ast] -> IO () stringDump :: SynSpec -> [Ast] -> String instance Monoid Extension