
18 Jul
2011
18 Jul
'11
4:27 a.m.
From the source of the package Text.ParserCombinators.ReadP, available at http://hackage.haskell.org/packages/archive/base/latest/doc/html/src/Text-Pa... :
many :: ReadP a -> ReadP [a] -- ^ Parses zero or more occurrences of the given parser. many p = return [] +++ many1 p many1 :: ReadP a -> ReadP [a] -- ^ Parses one or more occurrences of the given parser. many1 p = liftM2 (:) p (many p) So `many` is defined in terms of `many1` and vice versa - completely understandable, but here the argument (`p`) does not change. This is above me right now. Anyone care to explain? I'd be grateful. Not that I have to understand it, but it keeps pestering me during my lonely hours. /Fredrik