{-# LANGUAGE Rank2Types #-}
module Data.IntSet.Lens
( members
, setmapped
, setOf
) where
import Control.Lens
import Data.IntSet as IntSet
members :: Fold IntSet Int
members = folding IntSet.toAscList
{-# INLINE members #-}
setmapped :: IndexPreservingSetter' IntSet Int
setmapped = setting IntSet.map
{-# INLINE setmapped #-}
setOf :: Getting IntSet s Int -> s -> IntSet
setOf l = views l IntSet.singleton
{-# INLINE setOf #-}