{-# LANGUAGE Rank2Types #-}
module Data.Set.Lens
( setmapped
, setOf
) where
import Control.Lens.Getter ( Getting, views )
import Control.Lens.Setter ( setting )
import Control.Lens.Type
import Data.Set as Set
setmapped :: (Ord i, Ord j) => IndexPreservingSetter (Set i) (Set j) i j
setmapped = setting Set.map
{-# INLINE setmapped #-}
setOf :: Getting (Set a) s a -> s -> Set a
setOf l = views l Set.singleton
{-# INLINE setOf #-}