-- | test laziness import Text.Parsers.Frisby import System findAllMatches r = mdo regex <- r tryAgain <- newRule $ regex <> tryAgain ## uncurry (:) // anyChar ->> tryAgain // unit [] return $ tryAgain main = do let rx = regex "fo*" -- anyChar -- char 'f' -- "foo" str = cycle "foo" print $ take 3 $ runPeg (findAllMatches rx) str