Consider the Object-Oriented Languages:
Most people coming from an object-oriented programming background, are familiar with the common and intuitiv
The lens package provides some of this.
Testing for emptiness, creating empty containers These are both provided by the AsEmpty
typeclass from Control.Lens.Empty.
Accessing elements by key/index. The At
and Ixed
typeclasses from Control.Lens.At.
Checking for membership in set-like containers. The Contains
typeclass from Control.Lens.At.
Appending and deleting elements to sequence-like containers. The Cons
and Snoc
typeclasses from Control.Lens.Cons.
Also, the pure
method of the Applicative
typeclass can often be used to create "singleton" containers. For things that are not functors/applicatives in Haskell, like Set
, perhaps point
from Data.Pointed could be used.