filter (> "a") (fromList [(5,"a"), (3,"b")]) == singleton 3 "b" filter (> "x") (fromList [(5,"a"), (3,"b")]) == empty filter (< "a") (fromList [(5,"a"), (3,"b")]) == empty
filter (> "a") (fromList [(5,"a"), (3,"b")]) == singleton 3 "b" filter (> "x") (fromList [(5,"a"), (3,"b")]) == empty filter (< "a") (fromList [(5,"a"), (3,"b")]) == empty
filter p xs = [ x | x <- xs, p x]
>>> filter odd [1, 2, 3] [1,3]
filter (> "a") (fromList [(5,"a"), (3,"b")]) == singleton 3 "b" filter (> "x") (fromList [(5,"a"), (3,"b")]) == empty filter (< "a") (fromList [(5,"a"), (3,"b")]) == empty
filter (pure True) = cat filter (liftA2 (&&) p1 p2) = filter p1 >-> filter p2 filter f = mapMaybe (\a -> a <$ guard (f a))
ghci> Streams.fromList ["the", "quick", "brown", "fox"] >>= Streams.filter (/= "brown") >>= Streams.toList ["the","quick","fox"]