module Data.HashSet.Optics
( setmapped
, setOf
) where
import Data.Hashable (Hashable)
import Data.HashSet (HashSet)
import qualified Data.HashSet as HashSet
import Optics.Fold
import Optics.Optic
import Optics.Setter
setmapped :: (Eq b, Hashable b) => Setter (HashSet a) (HashSet b) a b
setmapped :: Setter (HashSet a) (HashSet b) a b
setmapped = ((a -> b) -> HashSet a -> HashSet b)
-> Setter (HashSet a) (HashSet b) a b
forall a b s t. ((a -> b) -> s -> t) -> Setter s t a b
sets (a -> b) -> HashSet a -> HashSet b
forall b a.
(Hashable b, Eq b) =>
(a -> b) -> HashSet a -> HashSet b
HashSet.map
{-# INLINE setmapped #-}
setOf :: (Is k A_Fold, Eq a, Hashable a) => Optic' k is s a -> s -> HashSet a
setOf :: Optic' k is s a -> s -> HashSet a
setOf Optic' k is s a
l = Optic' k is s a -> (a -> HashSet a) -> s -> HashSet a
forall k m (is :: IxList) s a.
(Is k A_Fold, Monoid m) =>
Optic' k is s a -> (a -> m) -> s -> m
foldMapOf Optic' k is s a
l a -> HashSet a
forall a. Hashable a => a -> HashSet a
HashSet.singleton
{-# INLINE setOf #-}