I was trying to use ghc-7.10 (RC 2) and got this message in a number of cases, e.g.,
src/Text/Regex/XMLSchema/Generic/RegexParser.hs:439:5:
Non type-variable argument
in the constraint: Text.Parsec.Prim.Stream s m Char
(Use FlexibleContexts to permit this)
When checking that ‘prop’ has the inferred type
prop :: forall s u (m :: * -> *) (t :: * -> *).
(Foldable t, Text.Parsec.Prim.Stream s m Char) =>
Char -> t Char -> Text.Parsec.Prim.ParsecT s u m [Char]
In an equation for ‘isCategory'’:
isCategory'
= (foldr1 (<|>) . map (uncurry prop)
$ [('L', "ultmo"), ('M', "nce"), ('N', "dlo"), ....])
<?> "illegal Unicode character property"
where
prop c1 cs2
= do { _ <- char c1;
.... }
Failed to install hxt-regex-xmlschema-9.2.0
This must be something that is introduced by the new ghc, or the new base that comes with it, or the new parsec (3.1.8), since it worked before.
source code snippet:
isCategory' :: Parser String
isCategory'
= ( foldr1 (<|>) . map (uncurry prop) $
[ ('L', "ultmo")
, ('M', "nce")
, ('N', "dlo")
, ('P', "cdseifo")
, ('Z', "slp")
, ('S', "mcko")
, ('C', "cfon")
]
) <?> "illegal Unicode character property"
where
prop c1 cs2
= do
_ <- char c1
s2 <- option ""
( do
c2 <- satisfy (`elem` cs2)
return [c2] )
return $ c1:s2
Note: I am not asking about this specific libray (hxt-*) since I observed this in other places also.