>>> any (> 3) [] False
>>> any (> 3) [1,2] False
>>> any (> 3) [1,2,3,4,5] True
>>> any (> 3) [1..] True
>>> any (> 3) [0, -1..] * Hangs forever *
Any x <> Any y = Any (x || y)
>>> Any True <> mempty <> Any False Any {getAny = True}
>>> mconcat (map (\x -> Any (even x)) [2,4,6,7,8]) Any {getAny = True}
>>> Any False <> mempty Any {getAny = False}
>>> anyM (readMaybe >=> pure . even) ["5", "10"] Just True >>> anyM (readMaybe >=> pure . even) ["10", "aba"] Just True >>> anyM (readMaybe >=> pure . even) ["aba", "10"] Nothing
>>> many (putStr "la") lalalalalalalalala... * goes on forever *
>>> many Nothing Just []
>>> take 5 <$> many (Just 1) * hangs forever *Note that this function can be used with Parsers based on Applicatives. In that case many parser will attempt to parse parser zero or more times until it fails.
>>> biany even isDigit (27, 't') False
>>> biany even isDigit (27, '8') True
>>> biany even isDigit (26, 't') True
>>> biany even isDigit (Left 27) False
>>> biany even isDigit (Left 26) True
>>> biany even isDigit (BiList [27, 53] ['t', '8']) TrueEmpty structures yield False:
>>> biany even isDigit (BiList [] []) False