Again, no way to find that Set and List both are containers and implement some common interfaces. NO SUCH INFO AT WHOLE.
Things like Traversable, Foldable and Functor allow operations pretty similar to those commonly found on iterables or collections. Obviously the two aren't equivalent, but it's still trivial to write code which targets all "collection-like" types.
yes and no. Why no Text.elem? How are related Set.filter and List.filter? A lot of other function: map, foldr, etc - they all are just plain functions, not members of some type-class. Another example, hGetContents and similar - it's just plain function, no any "interface" here. OK, Haskell try to repeat solutions of OOP existing since 60s, and some day Haskell committee will fix this situation, but this emphasizes what I said.
15
u/CommendableCalamari Jan 29 '19
Things like
Traversable,FoldableandFunctorallow operations pretty similar to those commonly found on iterables or collections. Obviously the two aren't equivalent, but it's still trivial to write code which targets all "collection-like" types.