[jhc] Parsec with JHC

Agent Zhang agentzh at gmail.com
Fri May 16 02:21:43 EDT 2008


Hi, there

Is it possible to compile Haskell programs using Parsec using JHC? I'm
trying jhc  0.5.20080307 (the rpm downloaded from JHC's homepage) with
the Parsec source tarball downloaded from here:

   http://legacy.cs.uu.nl/daan/download/parsec/parsec-2.0.zip

I'm getting the following errors during compiling:

   $ jhc Main.hs -i ~/tmp/haskell/parsec -o test
   jhc: Syntax error in input, run through a compiler to check.
        ERROR: the precedence of HsVar {hsExpName =
Text.ParserCombinators.Parsec.Prim.<|>} is incompatible with the
precendence of it's argument: HsInfixApp (HsVar {hsExpName =
Text.ParserCombinators.Parsec.Combinator.146_op}) (HsVar {hsExpName =
Jhc.Monad.>>=}) (HsLambda
/home/agentz/tmp/haskell/parsec/Text/ParserCombinators/Parsec/Combinator.hs:109:41
[HsPVar {hsPatName = Text.ParserCombinators.Parsec.Combinator.149_f}]
(HsInfixApp (HsVar {hsExpName =
Text.ParserCombinators.Parsec.Combinator.145_p}) (HsVar {hsExpName =
Jhc.Monad.>>=}) (HsLambda
/home/agentz/tmp/haskell/parsec/Text/ParserCombinators/Parsec/Combinator.hs:110:41
[HsPVar {hsPatName = Text.ParserCombinators.Parsec.Combinator.150_y}]
(HsApp (HsVar {hsExpName =
Text.ParserCombinators.Parsec.Combinator.147_rest}) (HsParen (HsApp
(HsApp (HsVar {hsExpName =
Text.ParserCombinators.Parsec.Combinator.149_f}) (HsVar {hsExpName =
Text.ParserCombinators.Parsec.Combinator.148_x})) (HsVar {hsExpName =
Text.ParserCombinators.Parsec.Combinator.150_y})))))))

Can I work around with it? Thanks in advance :)

Cheers,
-agentzh


More information about the jhc mailing list