>>> match (bounded 2 5 "cat") "catcatcat" [["cat","cat","cat"]] >>> match (bounded 2 5 "cat") "cat" [] >>> match (bounded 2 5 "cat") "catcatcatcatcatcat" []bounded could be implemented naively as follows:
bounded m n p = do x <- choice (map pure [m..n]) count x p
x /\ bottom == x x \/ top = x