lens-3.7.4: Lenses, Folds and Traversals

Portabilityportable
Stabilityprovisional
MaintainerEdward Kmett <ekmett@gmail.com>
Safe HaskellTrustworthy

Data.HashSet.Lens

Description

 

Synopsis

Documentation

setmapped :: (Eq i, Hashable i, Eq j, Hashable j) => Setter (HashSet i) (HashSet j) i jSource

This Setter can be used to change the type of a HashSet by mapping the elements to new values.

Sadly, you can't create a valid Traversal for a Set, but you can manipulate it by reading using folded and reindexing it via setmapped.

setOf :: Hashable a => Getting (HashSet a) s t a b -> s -> HashSet aSource

Construct a set from a Getter, Fold, Traversal, Lens or Iso.

 setOf :: Hashable a         => Getter s a           -> s -> HashSet a
 setOf :: (Eq a, Hashable a) => Fold s a             -> s -> HashSet a
 setOf :: Hashable a         => Simple Iso s a       -> s -> HashSet a
 setOf :: Hashable a         => Simple Lens s a      -> s -> HashSet a
 setOf :: (Eq a, Hashable a) => Simple Traversal s a -> s -> HashSet a