[Haskell-beginners] applicativeParsec.hs in Real World Haskell not compiling any more

Kees Bleijenberg k.bleijenberg at inter.nl.net
Wed Oct 24 19:40:02 CEST 2012

A year ago I made a program. I took code from ApplicativeParsec.hs (capt. 16
Real World Haskell).
The program compiled and ran flawless. Now (after a year) I've upgraded to
GHC version 7.0.4 (Windows) and I want to change something. But the
unchanged version doesn't compile any more. I get warning:
    Illegal instance declaration for `Applicative (GenParser s a)'
      (All instance types must be of the form (T t1 ... tn)
       where T is not a synonym.
       Use -XTypeSynonymInstances if you want to disable this.)
    In the instance declaration for `Applicative (GenParser s a)'
    Illegal instance declaration for `Alternative ....(same advice as above)
So I added TypeSynonymInstances. Then I got:
    Overlapping instances for Applicative (GenParser s a)
      arising from the superclasses of an instance declaration
    Matching instances:
      instance Applicative (Text.Parsec.Prim.ParsecT s u m)
        -- Defined in Text.Parsec.Prim
      instance Applicative (GenParser s a)
        -- Defined at ApplicativeParsec.hs:17:10-36
    In the instance declaration for `Alternative (GenParser s a)'
Then I added the OverlappingInstances directive. Same error and no
I wonder, is this the new GHC version? And what can I do about it?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20121024/27a9e085/attachment.htm>

More information about the Beginners mailing list