module Data.IntSet.Optics
( members
, setmapped
, setOf
) where
import Data.IntSet (IntSet)
import qualified Data.IntSet as IntSet
import Optics.Fold
import Optics.Optic
import Optics.Setter
members :: Fold IntSet Int
members :: Fold IntSet Int
members = (IntSet -> [Int]) -> Fold IntSet Int
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
folding IntSet -> [Int]
IntSet.toAscList
{-# INLINE members #-}
setmapped :: Setter' IntSet Int
setmapped :: Setter' IntSet Int
setmapped = ((Int -> Int) -> IntSet -> IntSet) -> Setter' IntSet Int
forall a b s t. ((a -> b) -> s -> t) -> Setter s t a b
sets (Int -> Int) -> IntSet -> IntSet
IntSet.map
{-# INLINE setmapped #-}
setOf :: Is k A_Fold => Optic' k is s Int -> s -> IntSet
setOf :: Optic' k is s Int -> s -> IntSet
setOf Optic' k is s Int
l = Optic' k is s Int -> (Int -> IntSet) -> s -> IntSet
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 Int
l Int -> IntSet
IntSet.singleton
{-# INLINE setOf #-}