[Haskell-cafe] Unexpected type error

Alexander Solla alex.solla at gmail.com
Sun Jun 12 23:00:41 CEST 2011


Hi everybody,

I'm having a bit of a problem with Parsec.  The most relevant error message
is:

 Couldn't match expected type `Text.Parsec.Prim.ParsecT
                                    String ()
Control.Monad.Identity.Identity String'
           against inferred type
`parsec-2.1.0.1:Text.ParserCombinators.Parsec.Prim.Parser
                                    [Char]'
 In the expression: countMinMax ...

So apparently, the module/package that defines countMinMax and the current
module are using different versions of Parsec.  My global GHC database has
Parsec 3.1.1 installed, but each package has the constraint

parsec                         >=2.1      && <2.2

Both modules use the exact same import line:

import Text.ParserCombinators.Parsec -- Lime.Data.IPAddress
import Text.ParserCombinators.Parsec -- Lime.Utility.Parsec

countMinMax :: (Integral n) => n -> n -> Parser a -> Parser [a]

and

the expression GHC is complaining about above has type Parser String.

The cabal-dev package database contains only one version of Parsec:

parsec-2.1.0.1-190ec41e7316b7eb7fddf355acddd826.conf

What's going on here?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20110612/b342ee88/attachment.htm>


More information about the Haskell-Cafe mailing list