Pig parser in haskell.

Latest on Hackage:

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow to host generated Haddocks.

MIT licensed by Elise Huard
Maintained by


Parser and pretty printer for the Apache Pig scripting language ( The current version is implemented using Parsec parser combinators.


Cabal project, now on hackage, so the usual

cabal install language-pig

Or from source

git clone ...
cd language-pig
cabal install


Parse an expression:

parseString :: [Char] -> Root

Returns an AST (type Root is the root node).

Parse a file:

parseFile :: FilePath -> IO PigFile

PigFile contains the Root (of AST) and the file name. If you want just the AST, parseFileForAST would do it.

Pretty print the produced tree:

putStrLn $ prettyPrint tree

So to round it up, if you want to parse and pretty print the parsed AST of a Pig file (using Control.Applicative (<$>))

prettyPrint <$> parseFileForAST "example.pig" >>= putStrLn
Used by 1 package:
comments powered byDisqus