what's the definition of "satisfy" and "<?>" ?

I cannot understand the following code very well as i donot know the definition of "satisfy" and "<?>". -- | Case-insensitive variant of Parsec's 'char' function. caseChar :: Char -> GenParser Char a Char caseChar c = satisfy (\x -> toUpper x == toUpper c) -- | Case-insensitive variant of Parsec's 'string' function. caseString :: String -> GenParser Char a () caseString cs = mapM_ caseChar cs <?> cs Would somebody mind to explain the code in detail ? Sincerely!

On Thu, May 21, 2009 at 2:10 PM, z_axis@163.com
I cannot understand the following code very well as i donot know the definition of "satisfy" and ">".
Did you check out the document of parsec? You can find definitions for 'satisty' and '>' in Text.ParserCombinators.Parsec.Char and Text.ParserCombinators.Prim, respectively. lee

"z_axis@163.com"
I cannot understand the following code very well as i donot know the definition of "satisfy" and ">".
Yes. Just look at the Parsec documentation, preferably Parsec 3, because Parsec versions prior to 3 were not well documented.
-- | Case-insensitive variant of Parsec's 'char' function. caseChar :: Char -> GenParser Char a Char caseChar c = satisfy (\x -> toUpper x == toUpper c)
-- | Case-insensitive variant of Parsec's 'string' function. caseString :: String -> GenParser Char a () caseString cs = mapM_ caseChar cs > cs
This code looks incorrect to me. It should read: caseString :: String -> GenParser Char a () caseString cs = Parsec.try (mapM_ caseChar cs) > cs Greets, Ertugrul. -- nightmare = unsafePerformIO (getWrongWife >>= sex) http://blog.ertes.de/
participants (3)
-
Ertugrul Soeylemez
-
Lee Duhem
-
z_axis@163.com