ReadP has this feature:
count :: Int -> ReadP a -> ReadP [a]
-- Usage:
count 3 $ satisfy (== 'c')
I am wondering if there is a similar function to parse between 3 and 8 occurrences:
count_between 3 8 $ satisfy (== 'c')
If I need to create my own, how would you do it?
source
to share