私はそれをしたい:
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 の世界でより簡単な (より美しい) 方法はありますか?