我想这样做:
findFirst :: Parser a -> String -> Maybe a
findFirst parser text =
search (maybeResult . parse parser . pack $ text) text where
search _ [] = Nothing
search Nothing _ = findFirst parser (DL.drop 1 text)
search res _ = res
它运作良好,但在attoparsec世界中有更简单(更美)的方式吗?