X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=Data%2FIntSet.hs;h=be51ce7a8cd6d9f915be1ecf4154f89ea8f79228;hb=2e317d707ce3512be60ada74a22119cd0a054ca1;hp=905309819d2042ab43d64bd6dc293d84e85dfb96;hpb=6ff8c23c29a6936f7e2f85663ccf5f1709dee181;p=ghc-base.git diff --git a/Data/IntSet.hs b/Data/IntSet.hs index 9053098..be51ce7 100644 --- a/Data/IntSet.hs +++ b/Data/IntSet.hs @@ -10,10 +10,11 @@ -- -- An efficient implementation of integer sets. -- --- This module is intended to be imported @qualified@, to avoid name --- clashes with "Prelude" functions. eg. +-- Since many function names (but not the type name) clash with +-- "Prelude" names, this module is usually imported @qualified@, e.g. -- --- > import Data.IntSet as Set +-- > import Data.IntSet (IntSet) +-- > import qualified Data.IntSet as IntSet -- -- The implementation is based on /big-endian patricia trees/. This data -- structure performs especially well on binary operations like 'union' @@ -92,7 +93,6 @@ module Data.IntSet ( import Prelude hiding (lookup,filter,foldr,foldl,null,map) import Data.Bits -import Data.Int import qualified Data.List as List import Data.Monoid (Monoid(..)) @@ -107,12 +107,11 @@ import qualified List #if __GLASGOW_HASKELL__ import Text.Read -import Data.Generics.Basics -import Data.Generics.Instances +import Data.Generics.Basics (Data(..), mkNorepType) +import Data.Generics.Instances () #endif #if __GLASGOW_HASKELL__ >= 503 -import GHC.Word import GHC.Exts ( Word(..), Int(..), shiftRL# ) #elif __GLASGOW_HASKELL__ import Word @@ -212,7 +211,7 @@ member x t -- | /O(log n)/. Is the element not in the set? notMember :: Int -> IntSet -> Bool -notMember k = not $ member k +notMember k = not . member k -- 'lookup' is used by 'intersection' for left-biasing lookup :: Int -> IntSet -> Maybe Int