ekmett / lens

Lenses, Folds, and Traversals - Join us on web.libera.chat #haskell-lens
http://lens.github.io/
Other
2.03k stars 273 forks source link

Document similarities between ‘filtered’ and ‘noneOf’ #690

Open Icelandjack opened 7 years ago

Icelandjack commented 7 years ago

Should the documentation mention the similarities between filtered and noneOf

noneOf id    :: (a -> Bool) -> (a -> Bool)
has.filtered :: (a -> Bool) -> (a -> Bool)

none                            :: (a -> Bool) -> (Foldable f => f a -> Bool)
noneOf folded                   :: (a -> Bool) -> (Foldable f => f a -> Bool) 
(\p -> has (folded.filtered p)) :: (a -> Bool) -> (Foldable f => f a -> Bool)
ekmett commented 7 years ago

I have no particular objection to commenting on this similarity in the docs.

However, one caveat is that filtered is somewhat stronger than what is documented above, and is just being narrowed down to folds "for real" by has.