{- Copyright (c) 2011 Robert Henderson
This source file is distributed under the terms of a BSD3-style
license, which can be found in the file LICENSE at the root of
this package. -}

-- | Extends "Data.Set"
--
module Data.Set.Rosso1
    (module Data.Set

    ,insertMany

    ) where

------------------------------------------------------
import Data.Set


-- | Inserts each element of the list into the set in turn, from left
-- to right.
--
insertMany :: Ord a => [a] -> Set a -> Set a
insertMany xs set = foldl (flip insert) set xs



-----------------------------------------------------------
{- UNIT TESTS

*Util.Set1e> insertMany [0..10] empty
fromList [0,1,2,3,4,5,6,7,8,9,10]
*Util.Set1e> insertMany [2, 5, 2, 4, 6, 10, 3] $ fromList [0..4]
fromList [0,1,2,3,4,5,6,10]

-}