[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

 Couldn't match expected type `Text.Parsec.Prim.ParsecT
                                    String ()
Control.Monad.Identity.Identity String'
           against inferred type
 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]


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

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


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