
29 Aug
2006
29 Aug
'06
9:38 a.m.
On Tue, Aug 29, 2006 at 03:11:09PM +0200,
Tomasz Zielonka
How about this?
It works fine, many thanks. Here is the version rewritten according to my taste: import Text.ParserCombinators.Parsec import Data.Maybe (catMaybes) countBetween m n p | n < m = error "First bound must be lower or equal than second bound" | otherwise = do xs <- count m p ys <- count (n - m) ((option Nothing) (do y <- p return (Just y))) return (xs ++ catMaybes ys)