Data.HashMap.Lazy: exported symbols usage examples

Symbols

  • ! No usage example found for this symbol :( Collapse [-]
    adjust No usage example found for this symbol :( Collapse [-]
    alter No usage example found for this symbol :( Collapse [-]
    delete See 9 Occurences [+] Collapse [-]
    Found in Data.ComposableAssociation.Aeson from the package composable-associations-aeson
          where proxy = Proxy :: Proxy key
                key = T.pack $ symbolVal proxy
    
    
    -- | Throws a @JsonObjectEncodingException@ if the base value isn't encoded as a JSON object
    instance (ToJSON base, ToJSON obj, KnownSymbol key) => ToJSON (base :<> Association key obj) where
      toJSON (base :<> Association key obj) = Object $ HashMap.insert keyName objJson baseJsonMap
        where keyName = T.pack $ symbolVal key
              baseJsonMap = case toJSON base of (Object jsonObjVal) -> jsonObjVal
                                                notAnObject -> throw $ JsonObjectEncodingException notAnObject
              objJson = toJSON obj
    
    instance (FromJSON base, FromJSON obj, KnownSymbol key) => FromJSON (base :<> Association key obj) where
      parseJSON = withObject "base :<> assoc" $ \v' -> (:<>) <$>
                                                parseJSON (Object $ HashMap.delete key v') <*>
                                                fmap (Association proxy) (v' .:? key .!= Null >>= parseJSON)
        where proxy = Proxy :: Proxy key
              key = T.pack $ symbolVal proxy
    
    -- $setup
    

    Found in Lens.Micro.Platform from the package microlens-platform
    type instance IxValue (Unboxed.Vector a) = a
    type instance Index   T.Text = Int
    type instance IxValue T.Text = Char
    type instance Index   TL.Text = Int64
    type instance IxValue TL.Text = Char
    
    instance (Eq k, Hashable k) => Ixed (HashMap k a) where
      ix k f m = case HashMap.lookup k m of
         Just v  -> f v <&> \v' -> HashMap.insert k v' m
         Nothing -> pure m
      {-# INLINE ix #-}
    
    instance (Eq k, Hashable k) => At (HashMap k a) where
      at k f m = f mv <&> \r -> case r of
        Nothing -> maybe m (const (HashMap.delete k m)) mv
        Just v' -> HashMap.insert k v' m
        where mv = HashMap.lookup k m
      {-# INLINE at #-}
    
    instance Ixed (Vector.Vector a) where
    

    Found in Control.Concurrent.STM.TMapChan.Hash from the package tmapchan
    tryObserve t k = do
      c <- getTChan t k
      tryPeekTChan c
    
    observeAll :: (Eq k, Hashable k) => TMapChan k a -> k -> STM [a]
    observeAll t k = do
      mNext <- tryObserve t k
      case mNext of
        Nothing -> pure []
        Just next -> (:) next <$> observeAll t k
    
    
    -- | Deletes the /next/ element in the map, if it exists. Doesn't block.
    delete :: (Eq k, Hashable k) => TMapChan k a -> k -> STM ()
    delete t k = void (tryLookup t k)
    
    -- | Clears the queue at the key
    deleteAll :: (Eq k, Hashable k) => TMapChan k a -> k -> STM ()
    deleteAll t k = void (lookupAll t k)
    

    Found in Control.Concurrent.STM.TMapChan.Hash from the package tmapchan
    tryObserve :: (Eq k, Hashable k) => TMapChan k a -> k -> STM (Maybe a)
    tryObserve t k = do
      c <- getTChan t k
      tryPeekTChan c
    
    observeAll :: (Eq k, Hashable k) => TMapChan k a -> k -> STM [a]
    observeAll t k = do
      mNext <- tryObserve t k
      case mNext of
        Nothing -> pure []
        Just next -> (:) next <$> observeAll t k
    
    
    -- | Deletes the /next/ element in the map, if it exists. Doesn't block.
    delete :: (Eq k, Hashable k) => TMapChan k a -> k -> STM ()
    delete t k = void (tryLookup t k)
    
    -- | Clears the queue at the key
    deleteAll :: (Eq k, Hashable k) => TMapChan k a -> k -> STM ()
    deleteAll t k = void (lookupAll t k)
    

    Found in Data.HashSet from the package unordered-containers
    member a s = case H.lookup a (asMap s) of
                   Just _ -> True
                   _      -> False
    {-# INLINABLE member #-}
    
    -- | /O(log n)/ Add the specified value to this set.
    insert :: (Eq a, Hashable a) => a -> HashSet a -> HashSet a
    insert a = HashSet . H.insert a () . asMap
    {-# INLINABLE insert #-}
    
    -- | /O(log n)/ Remove the specified value from this set if
    -- present.
    delete :: (Eq a, Hashable a) => a -> HashSet a -> HashSet a
    delete a = HashSet . H.delete a . asMap
    {-# INLINABLE delete #-}
    
    -- | /O(n)/ Transform this set by applying a function to every value.
    -- The resulting set may be smaller than the source.
    map :: (Hashable b, Eq b) => (a -> b) -> HashSet a -> HashSet b
    map f = fromList . List.map f . toList
    

    Found in Data.HashSet from the package unordered-containers
    member :: (Eq a, Hashable a) => a -> HashSet a -> Bool
    member a s = case H.lookup a (asMap s) of
                   Just _ -> True
                   _      -> False
    {-# INLINABLE member #-}
    
    -- | /O(log n)/ Add the specified value to this set.
    insert :: (Eq a, Hashable a) => a -> HashSet a -> HashSet a
    insert a = HashSet . H.insert a () . asMap
    {-# INLINABLE insert #-}
    
    -- | /O(log n)/ Remove the specified value from this set if
    -- present.
    delete :: (Eq a, Hashable a) => a -> HashSet a -> HashSet a
    delete a = HashSet . H.delete a . asMap
    {-# INLINABLE delete #-}
    
    -- | /O(n)/ Transform this set by applying a function to every value.
    -- The resulting set may be smaller than the source.
    map :: (Hashable b, Eq b) => (a -> b) -> HashSet a -> HashSet b
    

    Found in Data.HashSet from the package unordered-containers
    member :: (Eq a, Hashable a) => a -> HashSet a -> Bool
    member a s = case H.lookup a (asMap s) of
                   Just _ -> True
                   _      -> False
    {-# INLINABLE member #-}
    
    -- | /O(log n)/ Add the specified value to this set.
    insert :: (Eq a, Hashable a) => a -> HashSet a -> HashSet a
    insert a = HashSet . H.insert a () . asMap
    {-# INLINABLE insert #-}
    
    -- | /O(log n)/ Remove the specified value from this set if
    -- present.
    delete :: (Eq a, Hashable a) => a -> HashSet a -> HashSet a
    delete a = HashSet . H.delete a . asMap
    {-# INLINABLE delete #-}
    
    -- | /O(n)/ Transform this set by applying a function to every value.
    -- The resulting set may be smaller than the source.
    map :: (Hashable b, Eq b) => (a -> b) -> HashSet a -> HashSet b
    

    Found in Data.HashSet from the package unordered-containers
    -- set, 'False' otherwise.
    member :: (Eq a, Hashable a) => a -> HashSet a -> Bool
    member a s = case H.lookup a (asMap s) of
                   Just _ -> True
                   _      -> False
    {-# INLINABLE member #-}
    
    -- | /O(log n)/ Add the specified value to this set.
    insert :: (Eq a, Hashable a) => a -> HashSet a -> HashSet a
    insert a = HashSet . H.insert a () . asMap
    {-# INLINABLE insert #-}
    
    -- | /O(log n)/ Remove the specified value from this set if
    -- present.
    delete :: (Eq a, Hashable a) => a -> HashSet a -> HashSet a
    delete a = HashSet . H.delete a . asMap
    {-# INLINABLE delete #-}
    
    -- | /O(n)/ Transform this set by applying a function to every value.
    -- The resulting set may be smaller than the source.
    

    Found in Data.HashSet from the package unordered-containers
        -- * Construction
        , empty
        , singleton
    
        -- * Combine
        , union
        , unions
    
        -- * Basic interface
        , null
        , size
        , member
        , insert
        , delete
    
        -- * Transformations
        , map
    
          -- * Difference and intersection
    

    difference See 7 Occurences [+] Collapse [-]
    Found in Algebra.PartialOrd from the package lattices
    instance PartialOrd IS.IntSet where
        leq = IS.isSubsetOf
    
    instance (Eq k, Hashable k) => PartialOrd (HS.HashSet k) where
        leq a b = HS.null (HS.difference a b)
    
    instance (Ord k, PartialOrd v) => PartialOrd (M.Map k v) where
        leq = M.isSubmapOfBy leq
    
    instance PartialOrd v => PartialOrd (IM.IntMap v) where
        leq = IM.isSubmapOfBy leq
    
    instance (Eq k, Hashable k, PartialOrd v) => PartialOrd (HM.HashMap k v) where
        x `leq` y = {- wish: HM.isSubmapOfBy leq -}
            HM.null (HM.difference x y) && getAll (fold $ HM.intersectionWith (\vx vy -> All (vx `leq` vy)) x y)
    
    instance (PartialOrd a, PartialOrd b) => PartialOrd (a, b) where
        -- NB: *not* a lexical ordering. This is because for some component partial orders, lexical
        -- ordering is incompatible with the transitivity axiom we require for the derived partial order
        (x1, y1) `leq` (x2, y2) = x1 `leq` x2 && y1 `leq` y2
    

    Found in Algebra.PartialOrd from the package lattices
    instance PartialOrd Void where
        leq _ _ = True
    
    -- | @'leq' = 'Data.List.isInfixOf'@.
    instance Eq a => PartialOrd [a] where
        leq = L.isInfixOf
    
    instance Ord a => PartialOrd (S.Set a) where
        leq = S.isSubsetOf
    
    instance PartialOrd IS.IntSet where
        leq = IS.isSubsetOf
    
    instance (Eq k, Hashable k) => PartialOrd (HS.HashSet k) where
        leq a b = HS.null (HS.difference a b)
    
    instance (Ord k, PartialOrd v) => PartialOrd (M.Map k v) where
        leq = M.isSubmapOfBy leq
    
    instance PartialOrd v => PartialOrd (IM.IntMap v) where
    

    Found in Data.HashSet from the package unordered-containers
    delete :: (Eq a, Hashable a) => a -> HashSet a -> HashSet a
    delete a = HashSet . H.delete a . asMap
    {-# INLINABLE delete #-}
    
    -- | /O(n)/ Transform this set by applying a function to every value.
    -- The resulting set may be smaller than the source.
    map :: (Hashable b, Eq b) => (a -> b) -> HashSet a -> HashSet b
    map f = fromList . List.map f . toList
    {-# INLINE map #-}
    
    -- | /O(n)/ Difference of two sets. Return elements of the first set
    -- not existing in the second.
    difference :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
    difference (HashSet a) (HashSet b) = HashSet (H.difference a b)
    {-# INLINABLE difference #-}
    
    -- | /O(n)/ Intersection of two sets. Return elements present in both
    -- the first set and the second.
    intersection :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
    intersection (HashSet a) (HashSet b) = HashSet (H.intersection a b)
    

    Found in Data.HashSet from the package unordered-containers
    -- present.
    delete :: (Eq a, Hashable a) => a -> HashSet a -> HashSet a
    delete a = HashSet . H.delete a . asMap
    {-# INLINABLE delete #-}
    
    -- | /O(n)/ Transform this set by applying a function to every value.
    -- The resulting set may be smaller than the source.
    map :: (Hashable b, Eq b) => (a -> b) -> HashSet a -> HashSet b
    map f = fromList . List.map f . toList
    {-# INLINE map #-}
    
    -- | /O(n)/ Difference of two sets. Return elements of the first set
    -- not existing in the second.
    difference :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
    difference (HashSet a) (HashSet b) = HashSet (H.difference a b)
    {-# INLINABLE difference #-}
    
    -- | /O(n)/ Intersection of two sets. Return elements present in both
    -- the first set and the second.
    intersection :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
    

    Found in Data.HashSet from the package unordered-containers
    -- present.
    delete :: (Eq a, Hashable a) => a -> HashSet a -> HashSet a
    delete a = HashSet . H.delete a . asMap
    {-# INLINABLE delete #-}
    
    -- | /O(n)/ Transform this set by applying a function to every value.
    -- The resulting set may be smaller than the source.
    map :: (Hashable b, Eq b) => (a -> b) -> HashSet a -> HashSet b
    map f = fromList . List.map f . toList
    {-# INLINE map #-}
    
    -- | /O(n)/ Difference of two sets. Return elements of the first set
    -- not existing in the second.
    difference :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
    difference (HashSet a) (HashSet b) = HashSet (H.difference a b)
    {-# INLINABLE difference #-}
    
    -- | /O(n)/ Intersection of two sets. Return elements present in both
    -- the first set and the second.
    intersection :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
    

    Found in Data.HashSet from the package unordered-containers
    -- | /O(log n)/ Remove the specified value from this set if
    -- present.
    delete :: (Eq a, Hashable a) => a -> HashSet a -> HashSet a
    delete a = HashSet . H.delete a . asMap
    {-# INLINABLE delete #-}
    
    -- | /O(n)/ Transform this set by applying a function to every value.
    -- The resulting set may be smaller than the source.
    map :: (Hashable b, Eq b) => (a -> b) -> HashSet a -> HashSet b
    map f = fromList . List.map f . toList
    {-# INLINE map #-}
    
    -- | /O(n)/ Difference of two sets. Return elements of the first set
    -- not existing in the second.
    difference :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
    difference (HashSet a) (HashSet b) = HashSet (H.difference a b)
    {-# INLINABLE difference #-}
    
    -- | /O(n)/ Intersection of two sets. Return elements present in both
    -- the first set and the second.
    

    Found in Data.HashSet from the package unordered-containers
        , union
        , unions
    
        -- * Basic interface
        , null
        , size
        , member
        , insert
        , delete
    
        -- * Transformations
        , map
    
          -- * Difference and intersection
        , difference
        , intersection
    
        -- * Folds
        , foldl'
        , foldr
    

    differenceWith No usage example found for this symbol :( Collapse [-]
    elems No usage example found for this symbol :( Collapse [-]
    empty See 61 Occurences [+] Collapse [-]
    Found in Data.Configurator from the package configurator
        forM_ (matching changedOrGone) $ \(n',v) -> mapM_ (notify p n' v) acts
    
    -- | A completely empty configuration.
    empty :: Config
    empty = Config "" $ unsafePerformIO $ do
              p <- newIORef []
              m <- newIORef H.empty
              s <- newIORef H.empty
              return BaseConfig {
                           cfgAuto = Nothing
                         , cfgPaths = p
                         , cfgMap = m
                         , cfgSubs = s
                         }
    {-# NOINLINE empty #-}
    
    -- $format
    --
    -- A configuration file consists of a series of directives and
    -- comments, encoded in UTF-8.  A comment begins with a \"@#@\"
    

    Found in Data.Configurator from the package configurator
                         show (p,n) ++ ": " ++ show e
      go p@(Exact n) acts next = (const next =<<) $ do
        let v' = H.lookup n m'
        when (H.lookup n m /= v') . mapM_ (notify p n v') $ acts
      go p@(Prefix n) acts next = (const next =<<) $ do
        let matching = filter (T.isPrefixOf n . fst)
        forM_ (matching new) $ \(n',v) -> mapM_ (notify p n' (Just v)) acts
        forM_ (matching changedOrGone) $ \(n',v) -> mapM_ (notify p n' v) acts
    
    -- | A completely empty configuration.
    empty :: Config
    empty = Config "" $ unsafePerformIO $ do
              p <- newIORef []
              m <- newIORef H.empty
              s <- newIORef H.empty
              return BaseConfig {
                           cfgAuto = Nothing
                         , cfgPaths = p
                         , cfgMap = m
                         , cfgSubs = s
    

    Found in Data.Configurator from the package configurator
                         "*** a ChangeHandler threw an exception for " ++
                         show (p,n) ++ ": " ++ show e
      go p@(Exact n) acts next = (const next =<<) $ do
        let v' = H.lookup n m'
        when (H.lookup n m /= v') . mapM_ (notify p n v') $ acts
      go p@(Prefix n) acts next = (const next =<<) $ do
        let matching = filter (T.isPrefixOf n . fst)
        forM_ (matching new) $ \(n',v) -> mapM_ (notify p n' (Just v)) acts
        forM_ (matching changedOrGone) $ \(n',v) -> mapM_ (notify p n' v) acts
    
    -- | A completely empty configuration.
    empty :: Config
    empty = Config "" $ unsafePerformIO $ do
              p <- newIORef []
              m <- newIORef H.empty
              s <- newIORef H.empty
              return BaseConfig {
                           cfgAuto = Nothing
                         , cfgPaths = p
                         , cfgMap = m
    

    Found in Data.Configurator from the package configurator
      notify p n v a = a n v `E.catch` maybe report onError cfgAuto
        where report e = hPutStrLn stderr $
                         "*** a ChangeHandler threw an exception for " ++
                         show (p,n) ++ ": " ++ show e
      go p@(Exact n) acts next = (const next =<<) $ do
        let v' = H.lookup n m'
        when (H.lookup n m /= v') . mapM_ (notify p n v') $ acts
      go p@(Prefix n) acts next = (const next =<<) $ do
        let matching = filter (T.isPrefixOf n . fst)
        forM_ (matching new) $ \(n',v) -> mapM_ (notify p n' (Just v)) acts
        forM_ (matching changedOrGone) $ \(n',v) -> mapM_ (notify p n' v) acts
    
    -- | A completely empty configuration.
    empty :: Config
    empty = Config "" $ unsafePerformIO $ do
              p <- newIORef []
              m <- newIORef H.empty
              s <- newIORef H.empty
              return BaseConfig {
                           cfgAuto = Nothing
    

    Found in Data.Configurator from the package configurator
                                  _       -> nvs
      notify p n v a = a n v `E.catch` maybe report onError cfgAuto
        where report e = hPutStrLn stderr $
                         "*** a ChangeHandler threw an exception for " ++
                         show (p,n) ++ ": " ++ show e
      go p@(Exact n) acts next = (const next =<<) $ do
        let v' = H.lookup n m'
        when (H.lookup n m /= v') . mapM_ (notify p n v') $ acts
      go p@(Prefix n) acts next = (const next =<<) $ do
        let matching = filter (T.isPrefixOf n . fst)
        forM_ (matching new) $ \(n',v) -> mapM_ (notify p n' (Just v)) acts
        forM_ (matching changedOrGone) $ \(n',v) -> mapM_ (notify p n' v) acts
    
    -- | A completely empty configuration.
    empty :: Config
    empty = Config "" $ unsafePerformIO $ do
              p <- newIORef []
              m <- newIORef H.empty
              s <- newIORef H.empty
              return BaseConfig {
    

    Found in Data.Configurator from the package configurator
                  -> Config -> Name -> IO a
    lookupDefault def cfg name = fromMaybe def <$> lookup cfg name
    
    -- | Perform a simple dump of a 'Config' to @stdout@.
    display :: Config -> IO ()
    display (Config root BaseConfig{..}) = print . (root,) =<< readIORef cfgMap
    
    -- | Fetch the 'H.HashMap' that maps names to values.
    getMap :: Config -> IO (H.HashMap Name Value)
    getMap = readIORef . cfgMap . baseCfg
    
    flatten :: [(Name, Worth Path)]
            -> H.HashMap (Worth Path) [Directive]
            -> IO (H.HashMap Name Value)
    flatten roots files = foldM doPath H.empty roots
     where
      doPath m (pfx, f) = case H.lookup f files of
            Nothing -> return m
            Just ds -> foldM (directive pfx (worth f)) m ds
    

    Found in Data.Configurator from the package configurator
    -- | Create a 'Config' from the contents of the named files, placing them
    -- into named prefixes.  If a prefix is non-empty, it should end in a
    -- dot.
    loadGroups :: [(Name, Worth FilePath)] -> IO Config
    loadGroups files = fmap (Config "") $ load' Nothing files
    
    load' :: Maybe AutoConfig -> [(Name, Worth FilePath)] -> IO BaseConfig
    load' auto paths0 = do
      let second f (x,y) = (x, f y)
          paths          = map (second (fmap T.pack)) paths0
      ds <- loadFiles (map snd paths)
      p <- newIORef paths
      m <- newIORef =<< flatten paths ds
      s <- newIORef H.empty
      return BaseConfig {
                    cfgAuto = auto
                  , cfgPaths = p
                  , cfgMap = m
                  , cfgSubs = s
    

    Found in Data.Configurator from the package configurator
    import qualified Control.Exception as E
    import qualified Data.Attoparsec.Text as T
    import qualified Data.Attoparsec.Text.Lazy as L
    import qualified Data.HashMap.Lazy as H
    import qualified Data.Text as T
    import qualified Data.Text.Lazy as L
    import qualified Data.Text.Lazy.IO as L
    
    loadFiles :: [Worth Path] -> IO (H.HashMap (Worth Path) [Directive])
    loadFiles = foldM go H.empty
     where
       go seen path = do
         let rewrap n = const n <$> path
             wpath = worth path
         path' <- rewrap <$> interpolate "" wpath H.empty
         ds    <- loadOne (T.unpack <$> path')
         let !seen'    = H.insert path ds seen
             notSeen n = not . isJust . H.lookup n $ seen
         foldM go seen' . filter notSeen . importsOf wpath $ ds
    

    Found in Data.Configurator from the package configurator
    import System.Environment (getEnv)
    import System.IO (hPutStrLn, stderr)
    import System.IO.Unsafe (unsafePerformIO)
    import System.Posix.Types (EpochTime, FileOffset)
    import System.PosixCompat.Files (fileSize, getFileStatus, modificationTime)
    import qualified Control.Exception as E
    import qualified Data.Attoparsec.Text as T
    import qualified Data.Attoparsec.Text.Lazy as L
    import qualified Data.HashMap.Lazy as H
    import qualified Data.Text as T
    import qualified Data.Text.Lazy as L
    import qualified Data.Text.Lazy.IO as L
    
    loadFiles :: [Worth Path] -> IO (H.HashMap (Worth Path) [Directive])
    loadFiles = foldM go H.empty
     where
       go seen path = do
         let rewrap n = const n <$> path
             wpath = worth path
         path' <- rewrap <$> interpolate "" wpath H.empty
    

    Found in Data.Configurator from the package configurator
        -- $interp
    
        -- ** Grouping directives
        -- $group
    
        -- ** Importing files
        -- $import
    
        -- * Types
          Worth(..)
        -- * Loading configuration data
        , autoReload
        , autoReloadGroups
        , autoConfig
        , empty
        -- * Lookup functions
        , lookup
        , lookupDefault
        , require
        -- * Notification of configuration changes
    

    Found in Ersatz.Problem from the package ersatz
    class HasSAT t => HasQSAT t where
      qsat       :: Lens' t QSAT
      universals :: Lens' t IntSet
      universals f = qsat ago where
        ago (QSAT u s) = f u <&> \u' -> QSAT u' s
    
    instance HasSAT QSAT where
      sat f (QSAT u s) = QSAT u <$> f s
    
    instance HasQSAT QSAT where
      qsat = id
    
    instance Default QSAT where
      def = QSAT IntSet.empty def
    
    -- | Run a 'QSAT'-generating state computation. Useful e.g. in ghci for
    -- disambiguating the type of a 'MonadState', 'HasQSAT' value.
    runQSAT :: StateT QSAT m a -> m (a, QSAT)
    runQSAT s = runStateT s def
    

    Found in Ersatz.Problem from the package ersatz
      stableMap f = sat $ \ (SAT a b c) -> SAT a b <$> f c
    
    instance HasSAT SAT where
      sat = id
    
    instance Show SAT where
      showsPrec p bf = showParen (p > 10)
                     $ showString "SAT " . showsPrec 11 (bf^.lastAtom)
                     . showChar ' ' . showsPrec 11 (bf^.formula)
                     . showString " mempty"
    
    
    instance Default SAT where
      -- The literal 1 is dedicated for the True constant.
      def = SAT 1 (formulaLiteral literalTrue) HashMap.empty
    
    -- | Run a 'SAT'-generating state computation. Useful e.g. in ghci for
    -- disambiguating the type of a 'MonadState', 'HasSAT' value.
    runSAT :: StateT SAT m a -> m (a, SAT)
    runSAT s = runStateT s def
    

    Found in Linear.Vector from the package linear
      liftU2 = IntMap.unionWith
      {-# INLINE liftU2 #-}
      liftI2 = IntMap.intersectionWith
      {-# INLINE liftI2 #-}
    
    instance Ord k => Additive (Map k) where
      zero = Map.empty
      {-# INLINE zero #-}
      liftU2 = Map.unionWith
      {-# INLINE liftU2 #-}
      liftI2 = Map.intersectionWith
      {-# INLINE liftI2 #-}
    
    instance (Eq k, Hashable k) => Additive (HashMap k) where
      zero = HashMap.empty
      {-# INLINE zero #-}
      liftU2 = HashMap.unionWith
      {-# INLINE liftU2 #-}
      liftI2 = HashMap.intersectionWith
      {-# INLINE liftI2 #-}
    

    Found in Linear.Vector from the package linear
        go xs [] = xs
      {-# INLINE liftU2 #-}
      liftI2 = Prelude.zipWith
      {-# INLINE liftI2 #-}
    
    instance Additive IntMap where
      zero = IntMap.empty
      {-# INLINE zero #-}
      liftU2 = IntMap.unionWith
      {-# INLINE liftU2 #-}
      liftI2 = IntMap.intersectionWith
      {-# INLINE liftI2 #-}
    
    instance Ord k => Additive (Map k) where
      zero = Map.empty
      {-# INLINE zero #-}
      liftU2 = Map.unionWith
      {-# INLINE liftU2 #-}
      liftI2 = Map.intersectionWith
      {-# INLINE liftI2 #-}
    

    Found in Linear.Vector from the package linear
      {-# INLINE liftI2 #-}
    
    instance Additive [] where
      zero = []
      {-# INLINE zero #-}
      liftU2 f = go where
        go (x:xs) (y:ys) = f x y : go xs ys
        go [] ys = ys
        go xs [] = xs
      {-# INLINE liftU2 #-}
      liftI2 = Prelude.zipWith
      {-# INLINE liftI2 #-}
    
    instance Additive IntMap where
      zero = IntMap.empty
      {-# INLINE zero #-}
      liftU2 = IntMap.unionWith
      {-# INLINE liftU2 #-}
      liftI2 = IntMap.intersectionWith
      {-# INLINE liftI2 #-}
    

    Found in Lens.Micro.Platform from the package microlens-platform
    instance (Prim a, Prim b) => Snoc (Prim.Vector a) (Prim.Vector b) a b where
      _Snoc f s = if Prim.null s
        then pure Prim.empty
        else uncurry Prim.snoc <$> f (Prim.unsafeInit s, Prim.unsafeLast s)
      {-# INLINE _Snoc #-}
    
    instance (Storable a, Storable b) => Snoc (Storable.Vector a) (Storable.Vector b) a b where
      _Snoc f s = if Storable.null s
        then pure Storable.empty
        else uncurry Storable.snoc <$> f (Storable.unsafeInit s, Storable.unsafeLast s)
      {-# INLINE _Snoc #-}
    
    instance (Unbox a, Unbox b) => Snoc (Unboxed.Vector a) (Unboxed.Vector b) a b where
      _Snoc f s = if Unboxed.null s
        then pure Unboxed.empty
        else uncurry Unboxed.snoc <$> f (Unboxed.unsafeInit s, Unboxed.unsafeLast s)
      {-# INLINE _Snoc #-}
    
    instance Each (Vector.Vector a) (Vector.Vector b) a b where
      each = vectorTraverse
    

    Found in Lens.Micro.Platform from the package microlens-platform
    instance Snoc (Vector.Vector a) (Vector.Vector b) a b where
      _Snoc f s = if Vector.null s
        then pure Vector.empty
        else uncurry Vector.snoc <$> f (Vector.unsafeInit s, Vector.unsafeLast s)
      {-# INLINE _Snoc #-}
    
    instance (Prim a, Prim b) => Snoc (Prim.Vector a) (Prim.Vector b) a b where
      _Snoc f s = if Prim.null s
        then pure Prim.empty
        else uncurry Prim.snoc <$> f (Prim.unsafeInit s, Prim.unsafeLast s)
      {-# INLINE _Snoc #-}
    
    instance (Storable a, Storable b) => Snoc (Storable.Vector a) (Storable.Vector b) a b where
      _Snoc f s = if Storable.null s
        then pure Storable.empty
        else uncurry Storable.snoc <$> f (Storable.unsafeInit s, Storable.unsafeLast s)
      {-# INLINE _Snoc #-}
    
    instance (Unbox a, Unbox b) => Snoc (Unboxed.Vector a) (Unboxed.Vector b) a b where
      _Snoc f s = if Unboxed.null s
    

    Found in Lens.Micro.Platform from the package microlens-platform
    instance (Unbox a, Unbox b) => Cons (Unboxed.Vector a) (Unboxed.Vector b) a b where
      _Cons f s = if Unboxed.null s
        then pure Unboxed.empty
        else uncurry Unboxed.cons <$> f (Unboxed.unsafeHead s, Unboxed.unsafeTail s)
      {-# INLINE _Cons #-}
    
    instance Snoc (Vector.Vector a) (Vector.Vector b) a b where
      _Snoc f s = if Vector.null s
        then pure Vector.empty
        else uncurry Vector.snoc <$> f (Vector.unsafeInit s, Vector.unsafeLast s)
      {-# INLINE _Snoc #-}
    
    instance (Prim a, Prim b) => Snoc (Prim.Vector a) (Prim.Vector b) a b where
      _Snoc f s = if Prim.null s
        then pure Prim.empty
        else uncurry Prim.snoc <$> f (Prim.unsafeInit s, Prim.unsafeLast s)
      {-# INLINE _Snoc #-}
    
    instance (Storable a, Storable b) => Snoc (Storable.Vector a) (Storable.Vector b) a b where
      _Snoc f s = if Storable.null s
    

    Found in Lens.Micro.Platform from the package microlens-platform
    instance (Storable a, Storable b) => Cons (Storable.Vector a) (Storable.Vector b) a b where
      _Cons f s = if Storable.null s
        then pure Storable.empty
        else uncurry Storable.cons <$> f (Storable.unsafeHead s, Storable.unsafeTail s)
      {-# INLINE _Cons #-}
    
    instance (Unbox a, Unbox b) => Cons (Unboxed.Vector a) (Unboxed.Vector b) a b where
      _Cons f s = if Unboxed.null s
        then pure Unboxed.empty
        else uncurry Unboxed.cons <$> f (Unboxed.unsafeHead s, Unboxed.unsafeTail s)
      {-# INLINE _Cons #-}
    
    instance Snoc (Vector.Vector a) (Vector.Vector b) a b where
      _Snoc f s = if Vector.null s
        then pure Vector.empty
        else uncurry Vector.snoc <$> f (Vector.unsafeInit s, Vector.unsafeLast s)
      {-# INLINE _Snoc #-}
    
    instance (Prim a, Prim b) => Snoc (Prim.Vector a) (Prim.Vector b) a b where
      _Snoc f s = if Prim.null s
    

    Found in Lens.Micro.Platform from the package microlens-platform
    instance (Prim a, Prim b) => Cons (Prim.Vector a) (Prim.Vector b) a b where
      _Cons f s = if Prim.null s
        then pure Prim.empty
        else uncurry Prim.cons <$> f (Prim.unsafeHead s, Prim.unsafeTail s)
      {-# INLINE _Cons #-}
    
    instance (Storable a, Storable b) => Cons (Storable.Vector a) (Storable.Vector b) a b where
      _Cons f s = if Storable.null s
        then pure Storable.empty
        else uncurry Storable.cons <$> f (Storable.unsafeHead s, Storable.unsafeTail s)
      {-# INLINE _Cons #-}
    
    instance (Unbox a, Unbox b) => Cons (Unboxed.Vector a) (Unboxed.Vector b) a b where
      _Cons f s = if Unboxed.null s
        then pure Unboxed.empty
        else uncurry Unboxed.cons <$> f (Unboxed.unsafeHead s, Unboxed.unsafeTail s)
      {-# INLINE _Cons #-}
    
    instance Snoc (Vector.Vector a) (Vector.Vector b) a b where
      _Snoc f s = if Vector.null s
    

    Found in Lens.Micro.Platform from the package microlens-platform
    instance Cons (Vector.Vector a) (Vector.Vector b) a b where
      _Cons f s = if Vector.null s
        then pure Vector.empty
        else uncurry Vector.cons <$> f (Vector.unsafeHead s, Vector.unsafeTail s)
      {-# INLINE _Cons #-}
    
    instance (Prim a, Prim b) => Cons (Prim.Vector a) (Prim.Vector b) a b where
      _Cons f s = if Prim.null s
        then pure Prim.empty
        else uncurry Prim.cons <$> f (Prim.unsafeHead s, Prim.unsafeTail s)
      {-# INLINE _Cons #-}
    
    instance (Storable a, Storable b) => Cons (Storable.Vector a) (Storable.Vector b) a b where
      _Cons f s = if Storable.null s
        then pure Storable.empty
        else uncurry Storable.cons <$> f (Storable.unsafeHead s, Storable.unsafeTail s)
      {-# INLINE _Cons #-}
    
    instance (Unbox a, Unbox b) => Cons (Unboxed.Vector a) (Unboxed.Vector b) a b where
      _Cons f s = if Unboxed.null s
    

    Found in Lens.Micro.Platform from the package microlens-platform
    instance Snoc TL.Text TL.Text Char Char where
      _Snoc f s = if TL.null s
        then pure TL.empty
        else uncurry TL.snoc <$> f (TL.init s, TL.last s)
      {-# INLINE _Snoc #-}
    
    instance Cons (Vector.Vector a) (Vector.Vector b) a b where
      _Cons f s = if Vector.null s
        then pure Vector.empty
        else uncurry Vector.cons <$> f (Vector.unsafeHead s, Vector.unsafeTail s)
      {-# INLINE _Cons #-}
    
    instance (Prim a, Prim b) => Cons (Prim.Vector a) (Prim.Vector b) a b where
      _Cons f s = if Prim.null s
        then pure Prim.empty
        else uncurry Prim.cons <$> f (Prim.unsafeHead s, Prim.unsafeTail s)
      {-# INLINE _Cons #-}
    
    instance (Storable a, Storable b) => Cons (Storable.Vector a) (Storable.Vector b) a b where
      _Cons f s = if Storable.null s
    

    Found in Lens.Micro.Platform from the package microlens-platform
    instance Snoc T.Text T.Text Char Char where
      _Snoc f s = if T.null s
        then pure T.empty
        else uncurry T.snoc <$> f (T.init s, T.last s)
      {-# INLINE _Snoc #-}
    
    instance Snoc TL.Text TL.Text Char Char where
      _Snoc f s = if TL.null s
        then pure TL.empty
        else uncurry TL.snoc <$> f (TL.init s, TL.last s)
      {-# INLINE _Snoc #-}
    
    instance Cons (Vector.Vector a) (Vector.Vector b) a b where
      _Cons f s = if Vector.null s
        then pure Vector.empty
        else uncurry Vector.cons <$> f (Vector.unsafeHead s, Vector.unsafeTail s)
      {-# INLINE _Cons #-}
    
    instance (Prim a, Prim b) => Cons (Prim.Vector a) (Prim.Vector b) a b where
      _Cons f s = if Prim.null s
    

    Found in Lens.Micro.Platform from the package microlens-platform
    instance Cons TL.Text TL.Text Char Char where
      _Cons f s = case TL.uncons s of
        Just x  -> uncurry TL.cons <$> f x
        Nothing -> pure TL.empty
      {-# INLINE _Cons #-}
    
    instance Snoc T.Text T.Text Char Char where
      _Snoc f s = if T.null s
        then pure T.empty
        else uncurry T.snoc <$> f (T.init s, T.last s)
      {-# INLINE _Snoc #-}
    
    instance Snoc TL.Text TL.Text Char Char where
      _Snoc f s = if TL.null s
        then pure TL.empty
        else uncurry TL.snoc <$> f (TL.init s, TL.last s)
      {-# INLINE _Snoc #-}
    
    instance Cons (Vector.Vector a) (Vector.Vector b) a b where
      _Cons f s = if Vector.null s
    

    Found in Lens.Micro.Platform from the package microlens-platform
    instance Cons T.Text T.Text Char Char where
      _Cons f s = case T.uncons s of
        Just x  -> uncurry T.cons <$> f x
        Nothing -> pure T.empty
      {-# INLINE _Cons #-}
    
    instance Cons TL.Text TL.Text Char Char where
      _Cons f s = case TL.uncons s of
        Just x  -> uncurry TL.cons <$> f x
        Nothing -> pure TL.empty
      {-# INLINE _Cons #-}
    
    instance Snoc T.Text T.Text Char Char where
      _Snoc f s = if T.null s
        then pure T.empty
        else uncurry T.snoc <$> f (T.init s, T.last s)
      {-# INLINE _Snoc #-}
    
    instance Snoc TL.Text TL.Text Char Char where
      _Snoc f s = if TL.null s
    

    Found in Lens.Micro.Platform from the package microlens-platform
         (l, mr) -> case TL.uncons mr of
           Nothing      -> pure s
           Just (c, xs) -> f c <&> \d -> TL.append l (TL.cons d xs)
      {-# INLINE ix #-}
    
    instance Cons T.Text T.Text Char Char where
      _Cons f s = case T.uncons s of
        Just x  -> uncurry T.cons <$> f x
        Nothing -> pure T.empty
      {-# INLINE _Cons #-}
    
    instance Cons TL.Text TL.Text Char Char where
      _Cons f s = case TL.uncons s of
        Just x  -> uncurry TL.cons <$> f x
        Nothing -> pure TL.empty
      {-# INLINE _Cons #-}
    
    instance Snoc T.Text T.Text Char Char where
      _Snoc f s = if T.null s
        then pure T.empty
    

    Found in Lens.Micro.Platform from the package microlens-platform
           Nothing      -> pure s
           Just (c, xs) -> f c <&> \d -> T.concat [l, T.singleton d, xs]
      {-# INLINE ix #-}
    
    instance Ixed TL.Text where
      ix e f s = case TL.splitAt e s of
         (l, mr) -> case TL.uncons mr of
           Nothing      -> pure s
           Just (c, xs) -> f c <&> \d -> TL.append l (TL.cons d xs)
      {-# INLINE ix #-}
    
    instance Cons T.Text T.Text Char Char where
      _Cons f s = case T.uncons s of
        Just x  -> uncurry T.cons <$> f x
        Nothing -> pure T.empty
      {-# INLINE _Cons #-}
    
    instance Cons TL.Text TL.Text Char Char where
      _Cons f s = case TL.uncons s of
        Just x  -> uncurry TL.cons <$> f x
    

    Found in Data.Semigroup.Union from the package reducers
    instance HasUnionWith0 IntMap where
      emptyWith = IntMap.empty
    
    instance Ord k => HasUnionWith (Map k) where
      unionWith = Map.unionWith
    
    instance Ord k => HasUnionWith0 (Map k) where
      emptyWith = Map.empty
    
    instance (Eq k, Hashable k) => HasUnionWith (HashMap k) where
      unionWith = HashMap.unionWith
    
    instance (Eq k, Hashable k) => HasUnionWith0 (HashMap k) where
      emptyWith = HashMap.empty
    
    -- | The 'Monoid' @('unionWith mappend','empty')@ for containers full of monoids.
    newtype UnionWith f m = UnionWith { getUnionWith :: f m }
    
    instance (HasUnionWith f, Semigroup m) => Semigroup (UnionWith f m) where
    

    Found in Data.Semigroup.Union from the package reducers
    class HasUnionWith f => HasUnionWith0 f where
      emptyWith :: f a
    
    instance HasUnionWith IntMap where
      unionWith = IntMap.unionWith
    
    instance HasUnionWith0 IntMap where
      emptyWith = IntMap.empty
    
    instance Ord k => HasUnionWith (Map k) where
      unionWith = Map.unionWith
    
    instance Ord k => HasUnionWith0 (Map k) where
      emptyWith = Map.empty
    
    instance (Eq k, Hashable k) => HasUnionWith (HashMap k) where
      unionWith = HashMap.unionWith
    
    instance (Eq k, Hashable k) => HasUnionWith0 (HashMap k) where
    

    Found in Data.Semigroup.Union from the package reducers
    class Functor f => HasUnionWith f where
      unionWith :: (a -> a -> a) -> f a -> f a -> f a
    
    {-# SPECIALIZE unionWith :: (a -> a -> a) -> IntMap a -> IntMap a -> IntMap a #-}
    {-# SPECIALIZE unionWith :: Ord k => (a -> a -> a) -> Map k a -> Map k a -> Map k a #-}
    {-# SPECIALIZE unionWith :: Eq k => (a -> a -> a) -> HashMap k a -> HashMap k a -> HashMap k a #-}
    
    class HasUnionWith f => HasUnionWith0 f where
      emptyWith :: f a
    
    instance HasUnionWith IntMap where
      unionWith = IntMap.unionWith
    
    instance HasUnionWith0 IntMap where
      emptyWith = IntMap.empty
    
    instance Ord k => HasUnionWith (Map k) where
      unionWith = Map.unionWith
    
    instance Ord k => HasUnionWith0 (Map k) where
    

    Found in Data.Semigroup.Union from the package reducers
    instance (Eq a, Hashable a) => HasUnion0 (HashSet a) where
      empty = HashSet.empty
    
    
    -- | The 'Monoid' @('union','empty')@
    newtype Union f = Union { getUnion :: f }
      deriving (Eq,Ord,Show,Read)
    
    instance HasUnion f => Semigroup (Union f) where
      Union a <> Union b = Union (a `union` b)
    
    instance HasUnion0 f => Monoid (Union f) where
      Union a `mappend` Union b = Union (a `union` b)
      mempty = Union empty
    
    instance HasUnion f => Reducer f (Union f) where
      unit = Union
    
    instance Functor Union where
    

    Found in Data.Semigroup.Union from the package reducers
    instance Ord a => HasUnion0 (Set a) where
      empty = Set.empty
    
    instance HasUnion IntSet where
      union = IntSet.union
    
    instance HasUnion0 IntSet where
      empty = IntSet.empty
    
    instance (Eq a, Hashable a) => HasUnion (HashSet a) where
      union = HashSet.union
    
    instance (Eq a, Hashable a) => HasUnion0 (HashSet a) where
      empty = HashSet.empty
    
    
    -- | The 'Monoid' @('union','empty')@
    newtype Union f = Union { getUnion :: f }
      deriving (Eq,Ord,Show,Read)
    

    Found in Data.Semigroup.Union from the package reducers
    instance Ord a => HasUnion0 (Set a) where
      empty = Set.empty
    
    instance HasUnion IntSet where
      union = IntSet.union
    
    instance HasUnion0 IntSet where
      empty = IntSet.empty
    
    instance (Eq a, Hashable a) => HasUnion (HashSet a) where
      union = HashSet.union
    
    instance (Eq a, Hashable a) => HasUnion0 (HashSet a) where
      empty = HashSet.empty
    
    
    -- | The 'Monoid' @('union','empty')@
    newtype Union f = Union { getUnion :: f }
      deriving (Eq,Ord,Show,Read)
    

    Found in Data.Semigroup.Union from the package reducers
    instance Eq a => HasUnion0 [a] where
      empty = []
    
    instance Ord a => HasUnion (Set a) where
      union = Set.union
    
    instance Ord a => HasUnion0 (Set a) where
      empty = Set.empty
    
    instance HasUnion IntSet where
      union = IntSet.union
    
    instance HasUnion0 IntSet where
      empty = IntSet.empty
    
    instance (Eq a, Hashable a) => HasUnion (HashSet a) where
      union = HashSet.union
    
    instance (Eq a, Hashable a) => HasUnion0 (HashSet a) where
    

    Found in Data.Semigroup.Union from the package reducers
    instance Eq a => HasUnion0 [a] where
      empty = []
    
    instance Ord a => HasUnion (Set a) where
      union = Set.union
    
    instance Ord a => HasUnion0 (Set a) where
      empty = Set.empty
    
    instance HasUnion IntSet where
      union = IntSet.union
    
    instance HasUnion0 IntSet where
      empty = IntSet.empty
    
    instance (Eq a, Hashable a) => HasUnion (HashSet a) where
      union = HashSet.union
    
    instance (Eq a, Hashable a) => HasUnion0 (HashSet a) where
    

    Found in Data.Semigroup.Union from the package reducers
    instance Ord k => HasUnion0 (Map k a) where
      empty = Map.empty
    
    instance Eq a => HasUnion [a] where
      union = List.union
    
    instance Eq a => HasUnion0 [a] where
      empty = []
    
    instance Ord a => HasUnion (Set a) where
      union = Set.union
    
    instance Ord a => HasUnion0 (Set a) where
      empty = Set.empty
    
    instance HasUnion IntSet where
      union = IntSet.union
    
    instance HasUnion0 IntSet where
    

    Found in Data.Semigroup.Union from the package reducers
    instance Ord k => HasUnion0 (Map k a) where
      empty = Map.empty
    
    instance Eq a => HasUnion [a] where
      union = List.union
    
    instance Eq a => HasUnion0 [a] where
      empty = []
    
    instance Ord a => HasUnion (Set a) where
      union = Set.union
    
    instance Ord a => HasUnion0 (Set a) where
      empty = Set.empty
    
    instance HasUnion IntSet where
      union = IntSet.union
    
    instance HasUnion0 IntSet where
    

    Found in Data.Semigroup.Union from the package reducers
    instance (Eq k, Hashable k) => HasUnion0 (HashMap k a) where
      empty = HashMap.empty
    
    instance Ord k => HasUnion (Map k a) where
      union = Map.union
    
    instance Ord k => HasUnion0 (Map k a) where
      empty = Map.empty
    
    instance Eq a => HasUnion [a] where
      union = List.union
    
    instance Eq a => HasUnion0 [a] where
      empty = []
    
    instance Ord a => HasUnion (Set a) where
      union = Set.union
    
    instance Ord a => HasUnion0 (Set a) where
    

    Found in Data.Semigroup.Union from the package reducers
    instance HasUnion0 (IntMap a) where
      empty = IntMap.empty
    
    instance (Eq k, Hashable k) => HasUnion (HashMap k a) where
      union = HashMap.union
    
    instance (Eq k, Hashable k) => HasUnion0 (HashMap k a) where
      empty = HashMap.empty
    
    instance Ord k => HasUnion (Map k a) where
      union = Map.union
    
    instance Ord k => HasUnion0 (Map k a) where
      empty = Map.empty
    
    instance Eq a => HasUnion [a] where
      union = List.union
    
    instance Eq a => HasUnion0 [a] where
    

    Found in Data.Semigroup.Union from the package reducers
    instance HasUnion0 (IntMap a) where
      empty = IntMap.empty
    
    instance (Eq k, Hashable k) => HasUnion (HashMap k a) where
      union = HashMap.union
    
    instance (Eq k, Hashable k) => HasUnion0 (HashMap k a) where
      empty = HashMap.empty
    
    instance Ord k => HasUnion (Map k a) where
      union = Map.union
    
    instance Ord k => HasUnion0 (Map k a) where
      empty = Map.empty
    
    instance Eq a => HasUnion [a] where
      union = List.union
    
    instance Eq a => HasUnion0 [a] where
    

    Found in Data.Semigroup.Union from the package reducers
    class HasUnion f => HasUnion0 f where
      empty :: f
    
    instance HasUnion (IntMap a) where
      union = IntMap.union
    
    instance HasUnion0 (IntMap a) where
      empty = IntMap.empty
    
    instance (Eq k, Hashable k) => HasUnion (HashMap k a) where
      union = HashMap.union
    
    instance (Eq k, Hashable k) => HasUnion0 (HashMap k a) where
      empty = HashMap.empty
    
    instance Ord k => HasUnion (Map k a) where
      union = Map.union
    
    instance Ord k => HasUnion0 (Map k a) where
    

    Found in Data.Semigroup.Union from the package reducers
    class HasUnion f => HasUnion0 f where
      empty :: f
    
    instance HasUnion (IntMap a) where
      union = IntMap.union
    
    instance HasUnion0 (IntMap a) where
      empty = IntMap.empty
    
    instance (Eq k, Hashable k) => HasUnion (HashMap k a) where
      union = HashMap.union
    
    instance (Eq k, Hashable k) => HasUnion0 (HashMap k a) where
      empty = HashMap.empty
    
    instance Ord k => HasUnion (Map k a) where
      union = Map.union
    
    instance Ord k => HasUnion0 (Map k a) where
    

    Found in Data.Semigroup.Union from the package reducers
    {-# SPECIALIZE union :: Ord k => Map k a -> Map k a -> Map k a #-}
    {-# SPECIALIZE union :: Eq a => [a] -> [a] -> [a] #-}
    {-# SPECIALIZE union :: Ord a => Set a -> Set a -> Set a #-}
    {-# SPECIALIZE union :: IntSet -> IntSet -> IntSet #-}
    {-# SPECIALIZE union :: Eq a => HashSet a -> HashSet a -> HashSet a #-}
    {-# SPECIALIZE union :: Eq k => HashMap k a -> HashMap k a -> HashMap k a #-}
    
    class HasUnion f => HasUnion0 f where
      empty :: f
    
    instance HasUnion (IntMap a) where
      union = IntMap.union
    
    instance HasUnion0 (IntMap a) where
      empty = IntMap.empty
    
    instance (Eq k, Hashable k) => HasUnion (HashMap k a) where
      union = HashMap.union
    
    instance (Eq k, Hashable k) => HasUnion0 (HashMap k a) where
    

    Found in Data.Semigroup.Union from the package reducers
    {-# SPECIALIZE union :: Ord k => Map k a -> Map k a -> Map k a #-}
    {-# SPECIALIZE union :: Eq a => [a] -> [a] -> [a] #-}
    {-# SPECIALIZE union :: Ord a => Set a -> Set a -> Set a #-}
    {-# SPECIALIZE union :: IntSet -> IntSet -> IntSet #-}
    {-# SPECIALIZE union :: Eq a => HashSet a -> HashSet a -> HashSet a #-}
    {-# SPECIALIZE union :: Eq k => HashMap k a -> HashMap k a -> HashMap k a #-}
    
    class HasUnion f => HasUnion0 f where
      empty :: f
    
    instance HasUnion (IntMap a) where
      union = IntMap.union
    
    instance HasUnion0 (IntMap a) where
      empty = IntMap.empty
    
    instance (Eq k, Hashable k) => HasUnion (HashMap k a) where
      union = HashMap.union
    
    instance (Eq k, Hashable k) => HasUnion0 (HashMap k a) where
    

    Found in Data.Semigroup.Union from the package reducers
    -- | A Container suitable for the 'Union' 'Monoid'
    class HasUnion f where
      union :: f -> f -> f
    
    {-# SPECIALIZE union :: IntMap a -> IntMap a -> IntMap a #-}
    {-# SPECIALIZE union :: Ord k => Map k a -> Map k a -> Map k a #-}
    {-# SPECIALIZE union :: Eq a => [a] -> [a] -> [a] #-}
    {-# SPECIALIZE union :: Ord a => Set a -> Set a -> Set a #-}
    {-# SPECIALIZE union :: IntSet -> IntSet -> IntSet #-}
    {-# SPECIALIZE union :: Eq a => HashSet a -> HashSet a -> HashSet a #-}
    {-# SPECIALIZE union :: Eq k => HashMap k a -> HashMap k a -> HashMap k a #-}
    
    class HasUnion f => HasUnion0 f where
      empty :: f
    
    instance HasUnion (IntMap a) where
      union = IntMap.union
    
    instance HasUnion0 (IntMap a) where
    

    Found in Rest.StringMap.HashMap.Lazy from the package rest-stringmap
    fromHashMap :: HashMap a b -> StringHashMap a b
    fromHashMap = StringHashMap
    
    toHashMap :: StringHashMap a b -> HashMap a b
    toHashMap = unH
    
    fromList :: (Eq a, Hashable a) => [(a, b)] -> StringHashMap a b
    fromList = StringHashMap . H.fromList
    
    toList :: StringHashMap a b -> [(a, b)]
    toList = H.toList . unH
    
    -- | This is used with the assumption that a = b => f a = f b
    mapKeys ::  (Hashable l, Eq l) => (k -> l) -> StringHashMap k v -> StringHashMap l v
    mapKeys f = StringHashMap . H.foldlWithKey' (\h k v -> H.insert (f k) v h) H.empty . unH
    
    -- | Base case since XmlPickler expects strings
    instance XmlPickler b => XmlPickler (StringHashMap String b) where
      xpickle = pickleStringMap fromList toList
    

    Found in Control.Concurrent.STM.TMapChan.Hash from the package tmapchan
        as' <- observeAll t k'
        forM_ as' (writeTChan c)
      modifyTVar' xs (HashMap.insert k c)
    
    -- | Clones all the content from every channel, and inserts the unique subset of them to `k`, in an unspecified order.
    cloneAllUniquely :: ( Eq k, Hashable k
                        , Eq a, Hashable a
                        )
                      => TMapChan k a
                      -> k
                      -> STM ()
    cloneAllUniquely t@(TMapChan xs) k = do
      as <- readTVar xs
      c <- newTChan
      as' <- newTVar HashSet.empty
      forM_ (HashMap.keys as) $ \k' -> do
        as'More <- HashSet.fromList <$> observeAll t k'
        modifyTVar' as' (HashSet.union as'More)
      as'All <- HashSet.toList <$> readTVar as'
      forM_ as'All (writeTChan c)
    

    Found in Control.Concurrent.STM.TMapChan.Hash from the package tmapchan
    import Data.Hashable (Hashable)
    import Data.HashMap.Lazy (HashMap)
    import qualified Data.HashMap.Strict as HashMap
    import qualified Data.HashSet as HashSet
    import Control.Monad (void, forM_)
    import Control.Concurrent.STM (STM)
    import Control.Concurrent.STM.TChan (TChan, newTChan, writeTChan, readTChan, tryReadTChan, peekTChan, tryPeekTChan, unGetTChan)
    import Control.Concurrent.STM.TVar (TVar, newTVar, readTVar, writeTVar, modifyTVar')
    
    
    newtype TMapChan k a = TMapChan {runTMapChan :: TVar (HashMap k (TChan a))}
    
    
    newTMapChan :: STM (TMapChan k a)
    newTMapChan = TMapChan <$> newTVar HashMap.empty
    
    insert :: (Eq k, Hashable k) => TMapChan k a -> k -> a -> STM ()
    insert t k a = do
      c <- getTChan t k
      writeTChan c a
    

    Found in Toml.Parser from the package tomland
        nonEolCharP = satisfy (\c -> c /= '\n' && c /= '\r')
    
    multilineP :: Parser Text -> Parser Text -> Parser Text
    multilineP quotesP allowedCharP = lexeme $ fmap mconcat $ quotesP >> optional eol >> allowedCharP `manyTill` quotesP
    
    multilineBasicStringP :: Parser Text
    multilineBasicStringP = multilineP quotesP allowedCharP
      where
        quotesP = string "\"\"\""
    
        allowedCharP :: Parser Text
        allowedCharP = lineEndingBackslashP <|> escapeSequenceP <|> nonControlCharP <|> eol
    
        lineEndingBackslashP :: Parser Text
        lineEndingBackslashP = Text.empty <$ try (char '\\' >> eol >> space)
    
    multilineLiteralStringP :: Parser Text
    multilineLiteralStringP = multilineP quotesP allowedCharP
      where
        quotesP = string "'''"
    

    Found in Toml.Parser from the package tomland
    import qualified Text.Megaparsec as Mega (parse)
    import qualified Text.Megaparsec.Char.Lexer as L
    
    ----------------------------------------------------------------------------
    -- Library for parsing (boilerplate copy-pasted from megaparsec tutorial)
    ----------------------------------------------------------------------------
    
    type Parser = Parsec Void Text
    
    -- space consumer
    sc :: Parser ()
    sc = L.space space1 lineComment blockComment
      where
        lineComment  = L.skipLineComment "#"
        blockComment = empty
    
    -- wrapper for consuming spaces after every lexeme (not before it!)
    lexeme :: Parser a -> Parser a
    lexeme = L.lexeme sc
    

    Found in Data.Unfoldable.Restricted from the package unfoldable-restricted
    class (Hashable a, Eq a) => Hashable' a
    
    instance (Hashable a, Eq a) => Hashable' a
    
    
    instance UnfoldableR (Hashable') HashSet.HashSet where
      unfoldRestrict fa = choose
        [ pure HashSet.empty
        , HashSet.singleton <$> fa
        , HashSet.union <$> unfoldRestrict fa <*> unfoldRestrict fa
        ]
    
    instance BiunfoldableR (Hashable') (Unit) HashMap.HashMap where
      biunfoldRestrict fa fb = choose
        [ pure HashMap.empty
        , HashMap.singleton <$> fa <*> fb
        , HashMap.union <$> biunfoldRestrict fa fb <*> biunfoldRestrict fa fb
        ]
    
    -- Orig
    

    Found in Data.Unfoldable.Restricted from the package unfoldable-restricted
        , Map.union <$> biunfoldRestrict fa fb <*> biunfoldRestrict fa fb
        ]
    
    
    -- * Utils
    
    
    class (Hashable a, Eq a) => Hashable' a
    
    instance (Hashable a, Eq a) => Hashable' a
    
    
    instance UnfoldableR (Hashable') HashSet.HashSet where
      unfoldRestrict fa = choose
        [ pure HashSet.empty
        , HashSet.singleton <$> fa
        , HashSet.union <$> unfoldRestrict fa <*> unfoldRestrict fa
        ]
    
    instance BiunfoldableR (Hashable') (Unit) HashMap.HashMap where
    

    Found in Data.Unfoldable.Restricted from the package unfoldable-restricted
        unconsB (_,[])     = Nothing
        unconsB (as, b:bs) = Just (b, (as, bs))
    
    -- Containers
    
    instance UnfoldableR (Ord) Set.Set where
      unfoldRestrict fa = choose
        [ pure Set.empty
        , Set.singleton <$> fa
        , Set.union <$> unfoldRestrict fa <*> unfoldRestrict fa
        ]
    
    instance BiunfoldableR (Ord) Unit Map.Map where
      biunfoldRestrict fa fb = choose
        [ pure Map.empty
        , Map.singleton <$> fa <*> fb
        , Map.union <$> biunfoldRestrict fa fb <*> biunfoldRestrict fa fb
        ]
    

    Found in Data.Unfoldable.Restricted from the package unfoldable-restricted
                                then Just t else terminate ts
    
    fromLists :: (BiunfoldableR p q t, p a, q b) => [a] -> [b] -> Maybe (t a b)
    fromLists = curry $ biunfoldrRestrict unconsA unconsB
      where
        unconsA ([],_)     = Nothing
        unconsA (a:as, bs) = Just (a, (as, bs))
        unconsB (_,[])     = Nothing
        unconsB (as, b:bs) = Just (b, (as, bs))
    
    -- Containers
    
    instance UnfoldableR (Ord) Set.Set where
      unfoldRestrict fa = choose
        [ pure Set.empty
        , Set.singleton <$> fa
        , Set.union <$> unfoldRestrict fa <*> unfoldRestrict fa
        ]
    
    instance BiunfoldableR (Ord) Unit Map.Map where
    

    Found in Data.HashSet from the package unordered-containers
    -- predicate.
    filter :: (a -> Bool) -> HashSet a -> HashSet a
    filter p = HashSet . H.filterWithKey q . asMap
      where q k _ = p k
    {-# INLINE filter #-}
    
    -- | /O(n)/ Return a list of this set's elements.  The list is
    -- produced lazily.
    toList :: HashSet a -> [a]
    toList t = build (\ c z -> foldrWithKey ((const .) c) z (asMap t))
    {-# INLINE toList #-}
    
    -- | /O(n*min(W, n))/ Construct a set from a list of elements.
    fromList :: (Eq a, Hashable a) => [a] -> HashSet a
    fromList = HashSet . List.foldl' (\ m k -> H.insert k () m) H.empty
    {-# INLINE fromList #-}
    
    #if __GLASGOW_HASKELL__ >= 708
    instance (Eq a, Hashable a) => Exts.IsList (HashSet a) where
        type Item (HashSet a) = a
    

    Found in Data.HashSet from the package unordered-containers
    fromMap = HashSet
    
    -- | /O(n+m)/ Construct a set containing all elements from both sets.
    --
    -- To obtain good performance, the smaller set must be presented as
    -- the first argument.
    union :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
    union s1 s2 = HashSet $ H.union (asMap s1) (asMap s2)
    {-# INLINE union #-}
    
    -- TODO: Figure out the time complexity of 'unions'.
    
    -- | Construct a set containing all elements from a list of sets.
    unions :: (Eq a, Hashable a) => [HashSet a] -> HashSet a
    unions = List.foldl' union empty
    {-# INLINE unions #-}
    
    -- | /O(1)/ Return 'True' if this set is empty, 'False' otherwise.
    null :: HashSet a -> Bool
    null = H.null . asMap
    

    Found in Data.HashSet from the package unordered-containers
        liftHashWithSalt h s = H.liftHashWithSalt2 h hashWithSalt s . asMap
    #endif
    
    instance (Hashable a) => Hashable (HashSet a) where
        hashWithSalt salt = hashWithSalt salt . asMap
    
    fromListConstr :: Constr
    fromListConstr = mkConstr hashSetDataType "fromList" [] Prefix
    
    hashSetDataType :: DataType
    hashSetDataType = mkDataType "Data.HashSet" [fromListConstr]
    
    -- | /O(1)/ Construct an empty set.
    empty :: HashSet a
    empty = HashSet H.empty
    
    -- | /O(1)/ Construct a set with a single element.
    singleton :: Hashable a => a -> HashSet a
    singleton a = HashSet (H.singleton a ())
    {-# INLINABLE singleton #-}
    

    Found in Data.HashSet from the package unordered-containers
        liftHashWithSalt h s = H.liftHashWithSalt2 h hashWithSalt s . asMap
    #endif
    
    instance (Hashable a) => Hashable (HashSet a) where
        hashWithSalt salt = hashWithSalt salt . asMap
    
    fromListConstr :: Constr
    fromListConstr = mkConstr hashSetDataType "fromList" [] Prefix
    
    hashSetDataType :: DataType
    hashSetDataType = mkDataType "Data.HashSet" [fromListConstr]
    
    -- | /O(1)/ Construct an empty set.
    empty :: HashSet a
    empty = HashSet H.empty
    
    -- | /O(1)/ Construct a set with a single element.
    singleton :: Hashable a => a -> HashSet a
    singleton a = HashSet (H.singleton a ())
    {-# INLINABLE singleton #-}
    

    Found in Data.HashSet from the package unordered-containers
    instance H.Hashable1 HashSet where
        liftHashWithSalt h s = H.liftHashWithSalt2 h hashWithSalt s . asMap
    #endif
    
    instance (Hashable a) => Hashable (HashSet a) where
        hashWithSalt salt = hashWithSalt salt . asMap
    
    fromListConstr :: Constr
    fromListConstr = mkConstr hashSetDataType "fromList" [] Prefix
    
    hashSetDataType :: DataType
    hashSetDataType = mkDataType "Data.HashSet" [fromListConstr]
    
    -- | /O(1)/ Construct an empty set.
    empty :: HashSet a
    empty = HashSet H.empty
    
    -- | /O(1)/ Construct a set with a single element.
    singleton :: Hashable a => a -> HashSet a
    singleton a = HashSet (H.singleton a ())
    

    Found in Data.HashSet from the package unordered-containers
        liftCompare c (HashSet a) (HashSet b) = liftCompare2 c compare a b
    #endif
    
    instance Foldable.Foldable HashSet where
        foldr = Data.HashSet.foldr
        {-# INLINE foldr #-}
    
    #if __GLASGOW_HASKELL__ >= 711
    instance (Hashable a, Eq a) => Semigroup (HashSet a) where
        (<>) = union
        {-# INLINE (<>) #-}
    #endif
    
    instance (Hashable a, Eq a) => Monoid (HashSet a) where
        mempty = empty
        {-# INLINE mempty #-}
    #if __GLASGOW_HASKELL__ >= 711
        mappend = (<>)
    #else
        mappend = union
    

    Found in Data.HashSet from the package unordered-containers
    -- The implementation is based on /hash array mapped trie/.  A
    -- 'HashSet' is often faster than other tree-based set types,
    -- especially when value comparison is expensive, as in the case of
    -- strings.
    --
    -- Many operations have a average-case complexity of /O(log n)/.  The
    -- implementation uses a large base (i.e. 16) so in practice these
    -- operations are constant time.
    
    module Data.HashSet
        (
          HashSet
    
        -- * Construction
        , empty
        , singleton
    
        -- * Combine
        , union
        , unions
    

    filter See 8 Occurences [+] Collapse [-]
    Found in Data.Configurator from the package configurator
                                          | otherwise -> nvs
                                  _                   -> (n,Nothing):nvs
      new = H.foldrWithKey check [] m'
          where check n v nvs = case H.lookup n m of
                                  Nothing -> (n,v):nvs
                                  _       -> nvs
      notify p n v a = a n v `E.catch` maybe report onError cfgAuto
        where report e = hPutStrLn stderr $
                         "*** a ChangeHandler threw an exception for " ++
                         show (p,n) ++ ": " ++ show e
      go p@(Exact n) acts next = (const next =<<) $ do
        let v' = H.lookup n m'
        when (H.lookup n m /= v') . mapM_ (notify p n v') $ acts
      go p@(Prefix n) acts next = (const next =<<) $ do
        let matching = filter (T.isPrefixOf n . fst)
        forM_ (matching new) $ \(n',v) -> mapM_ (notify p n' (Just v)) acts
        forM_ (matching changedOrGone) $ \(n',v) -> mapM_ (notify p n' v) acts
    
    -- | A completely empty configuration.
    empty :: Config
    

    Found in Data.Configurator from the package configurator
    interpolate :: T.Text -> T.Text -> H.HashMap Name Value -> IO T.Text
    interpolate pfx s env
        | "$" `T.isInfixOf` s =
          case T.parseOnly interp s of
            Left err   -> throwIO $ ParseError "" err
            Right xs -> (L.toStrict . toLazyText . mconcat) <$> mapM interpret xs
        | otherwise = return s
     where
      lookupEnv name = msum $ map (flip H.lookup env) fullnames
        where fullnames = map (T.intercalate ".")     -- ["a.b.c.x","a.b.x","a.x","x"]
                        . map (reverse . (name:)) -- [["a","b","c","x"],["a","b","x"],["a","x"],["x"]]
                        . tails                   -- [["c","b","a"],["b","a"],["a"],[]]
                        . reverse                 -- ["c","b","a"]
                        . filter (not . T.null)   -- ["a","b","c"]
                        . T.split (=='.')         -- ["a","b","c",""]
                        $ pfx                     -- "a.b.c."
    
      interpret (Literal x)   = return (fromText x)
      interpret (Interpolate name) =
    

    Found in Data.Configurator from the package configurator
    import qualified Data.Text as T
    import qualified Data.Text.Lazy as L
    import qualified Data.Text.Lazy.IO as L
    
    loadFiles :: [Worth Path] -> IO (H.HashMap (Worth Path) [Directive])
    loadFiles = foldM go H.empty
     where
       go seen path = do
         let rewrap n = const n <$> path
             wpath = worth path
         path' <- rewrap <$> interpolate "" wpath H.empty
         ds    <- loadOne (T.unpack <$> path')
         let !seen'    = H.insert path ds seen
             notSeen n = not . isJust . H.lookup n $ seen
         foldM go seen' . filter notSeen . importsOf wpath $ ds
    
    -- | Create a 'Config' from the contents of the named files. Throws an
    -- exception on error, such as if files do not exist or contain errors.
    --
    -- File names have any environment variables expanded prior to the
    

    Found in Data.HashSet from the package unordered-containers
    -- | /O(n)/ Reduce this set by applying a binary operator to all
    -- elements, using the given starting value (typically the
    -- right-identity of the operator).
    foldr :: (b -> a -> a) -> a -> HashSet b -> a
    foldr f z0 = foldrWithKey g z0 . asMap
      where g k _ z = f k z
    {-# INLINE foldr #-}
    
    -- | /O(n)/ Filter this set by retaining only elements satisfying a
    -- predicate.
    filter :: (a -> Bool) -> HashSet a -> HashSet a
    filter p = HashSet . H.filterWithKey q . asMap
      where q k _ = p k
    {-# INLINE filter #-}
    
    -- | /O(n)/ Return a list of this set's elements.  The list is
    -- produced lazily.
    toList :: HashSet a -> [a]
    toList t = build (\ c z -> foldrWithKey ((const .) c) z (asMap t))
    

    Found in Data.HashSet from the package unordered-containers
      where g z k _ = f z k
    {-# INLINE foldl' #-}
    
    -- | /O(n)/ Reduce this set by applying a binary operator to all
    -- elements, using the given starting value (typically the
    -- right-identity of the operator).
    foldr :: (b -> a -> a) -> a -> HashSet b -> a
    foldr f z0 = foldrWithKey g z0 . asMap
      where g k _ z = f k z
    {-# INLINE foldr #-}
    
    -- | /O(n)/ Filter this set by retaining only elements satisfying a
    -- predicate.
    filter :: (a -> Bool) -> HashSet a -> HashSet a
    filter p = HashSet . H.filterWithKey q . asMap
      where q k _ = p k
    {-# INLINE filter #-}
    
    -- | /O(n)/ Return a list of this set's elements.  The list is
    -- produced lazily.
    

    Found in Data.HashSet from the package unordered-containers
    foldl' f z0 = H.foldlWithKey' g z0 . asMap
      where g z k _ = f z k
    {-# INLINE foldl' #-}
    
    -- | /O(n)/ Reduce this set by applying a binary operator to all
    -- elements, using the given starting value (typically the
    -- right-identity of the operator).
    foldr :: (b -> a -> a) -> a -> HashSet b -> a
    foldr f z0 = foldrWithKey g z0 . asMap
      where g k _ z = f k z
    {-# INLINE foldr #-}
    
    -- | /O(n)/ Filter this set by retaining only elements satisfying a
    -- predicate.
    filter :: (a -> Bool) -> HashSet a -> HashSet a
    filter p = HashSet . H.filterWithKey q . asMap
      where q k _ = p k
    {-# INLINE filter #-}
    
    -- | /O(n)/ Return a list of this set's elements.  The list is
    

    Found in Data.HashSet from the package unordered-containers
        , toMap
        , fromMap
        ) where
    
    import Control.DeepSeq (NFData(..))
    import Data.Data hiding (Typeable)
    import Data.HashMap.Base (HashMap, foldrWithKey, equalKeys)
    import Data.Hashable (Hashable(hashWithSalt))
    #if __GLASGOW_HASKELL__ >= 711
    import Data.Semigroup (Semigroup(..))
    #elif __GLASGOW_HASKELL__ < 709
    import Data.Monoid (Monoid(..))
    #endif
    import GHC.Exts (build)
    import Prelude hiding (filter, foldr, map, null)
    import qualified Data.Foldable as Foldable
    import qualified Data.HashMap.Lazy as H
    import qualified Data.List as List
    import Data.Typeable (Typeable)
    import Text.Read
    

    Found in Data.HashSet from the package unordered-containers
        , delete
    
        -- * Transformations
        , map
    
          -- * Difference and intersection
        , difference
        , intersection
    
        -- * Folds
        , foldl'
        , foldr
    
        -- * Filter
        , filter
    
        -- * Conversions
    
        -- ** Lists
        , toList
    

    filterWithKey See 1 Occurences [+] Collapse [-]
    Found in Data.HashSet from the package unordered-containers
      where g z k _ = f z k
    {-# INLINE foldl' #-}
    
    -- | /O(n)/ Reduce this set by applying a binary operator to all
    -- elements, using the given starting value (typically the
    -- right-identity of the operator).
    foldr :: (b -> a -> a) -> a -> HashSet b -> a
    foldr f z0 = foldrWithKey g z0 . asMap
      where g k _ z = f k z
    {-# INLINE foldr #-}
    
    -- | /O(n)/ Filter this set by retaining only elements satisfying a
    -- predicate.
    filter :: (a -> Bool) -> HashSet a -> HashSet a
    filter p = HashSet . H.filterWithKey q . asMap
      where q k _ = p k
    {-# INLINE filter #-}
    
    -- | /O(n)/ Return a list of this set's elements.  The list is
    -- produced lazily.
    

    foldl' See 12 Occurences [+] Collapse [-]
    Found in Data.Binary.Orphans from the package binary-orphans
                _ -> do bytes <- get
                        return $! roll bytes
    
    
    --
    -- Fold and unfold an Integer to and from a list of its bytes
    --
    unroll :: (Integral a, Bits a) => a -> [Word8]
    unroll = unfoldr step
      where
        step 0 = Nothing
        step i = Just (fromIntegral i, i `shiftR` 8)
    
    roll :: (Integral a, Bits a) => [Word8] -> a
    roll   = foldl' unstep 0 . reverse
      where
        unstep a b = a `shiftL` 8 .|. fromIntegral b
    #endif
    

    Found in Data.Binary.Orphans from the package binary-orphans
      Binary(..),
      -- * Module re-export
      module Data.Binary,
      ) where
    
    import           Control.Monad (liftM, liftM2, liftM3)
    import qualified Data.Aeson as A
    import           Data.Bits
    import           Data.Binary
    import qualified Data.CaseInsensitive as CI
    import qualified Data.Fixed as Fixed
    import qualified Data.HashMap.Lazy as HM
    import qualified Data.HashSet as HS
    import qualified Data.Hashable as Hashable
    import           Data.List (unfoldr, foldl')
    import qualified Data.List.NonEmpty as NE
    import qualified Data.Monoid as Monoid
    import qualified Data.Semigroup as Semigroup
    import qualified Data.Tagged as Tagged
    import qualified Data.Time as Time
    

    Found in Ersatz.Problem from the package ersatz
        comments = foldMap bComment (wdimacsComments t)
        problem = bLine [ string7 "p wcnf"
                        , intDec (wdimacsNumVariables t)
                        , intDec (Seq.length tClauses)
                        , int64Dec (wdimacsTopWeight t)
                        ]
        clauses = foldMap (uncurry bWClause) tClauses
    
        tClauses = wdimacsClauses t
    
    bComment :: ByteString -> Builder
    bComment bs = bLine [ char7 'c', byteString bs ]
    
    bClause :: IntSet -> Builder
    bClause = IntSet.foldl' ( \ e i -> intDec i <> char7 ' ' <> e ) ( char7 '0' <> char7 '\n' )
    
    bWClause :: Int64 -> IntSet -> Builder
    bWClause w ls = bLine0 (int64Dec w : map intDec (IntSet.toList ls))
    
    bLine0 :: [Builder] -> Builder
    

    Found in Linear.Vector from the package linear
    -- | Compute the negation of a vector
    --
    -- >>> negated (V2 2 4)
    -- V2 (-2) (-4)
    negated :: (Functor f, Num a) => f a -> f a
    negated = fmap negate
    {-# INLINE negated #-}
    
    -- | Sum over multiple vectors
    --
    -- >>> sumV [V2 1 1, V2 3 4]
    -- V2 4 5
    sumV :: (Foldable f, Additive v, Num a) => f (v a) -> v a
    sumV = Foldable.foldl' (^+^) zero
    {-# INLINE sumV #-}
    
    -- | Compute the left scalar product
    --
    -- >>> 2 *^ V2 3 4
    

    Found in Linear.Vector from the package linear
      , sumV
      , basis
      , basisFor
      , scaled
      , outer
      , unit
      ) where
    
    import Control.Applicative
    import Control.Lens
    import Data.Complex
    #if __GLASGOW_HASKELL__ < 710
    import Data.Foldable as Foldable (Foldable, forM_, foldl')
    #else
    import Data.Foldable as Foldable (forM_, foldl')
    #endif
    import Data.HashMap.Lazy as HashMap
    import Data.Hashable
    import Data.IntMap as IntMap
    import Data.Map as Map
    

    Found in Linear.Vector from the package linear
      , (*^)
      , (^/)
      , sumV
      , basis
      , basisFor
      , scaled
      , outer
      , unit
      ) where
    
    import Control.Applicative
    import Control.Lens
    import Data.Complex
    #if __GLASGOW_HASKELL__ < 710
    import Data.Foldable as Foldable (Foldable, forM_, foldl')
    #else
    import Data.Foldable as Foldable (forM_, foldl')
    #endif
    import Data.HashMap.Lazy as HashMap
    import Data.Hashable
    

    Found in Data.HashSet from the package unordered-containers
    -- predicate.
    filter :: (a -> Bool) -> HashSet a -> HashSet a
    filter p = HashSet . H.filterWithKey q . asMap
      where q k _ = p k
    {-# INLINE filter #-}
    
    -- | /O(n)/ Return a list of this set's elements.  The list is
    -- produced lazily.
    toList :: HashSet a -> [a]
    toList t = build (\ c z -> foldrWithKey ((const .) c) z (asMap t))
    {-# INLINE toList #-}
    
    -- | /O(n*min(W, n))/ Construct a set from a list of elements.
    fromList :: (Eq a, Hashable a) => [a] -> HashSet a
    fromList = HashSet . List.foldl' (\ m k -> H.insert k () m) H.empty
    {-# INLINE fromList #-}
    
    #if __GLASGOW_HASKELL__ >= 708
    instance (Eq a, Hashable a) => Exts.IsList (HashSet a) where
        type Item (HashSet a) = a
    

    Found in Data.HashSet from the package unordered-containers
    -- | /O(n)/ Intersection of two sets. Return elements present in both
    -- the first set and the second.
    intersection :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
    intersection (HashSet a) (HashSet b) = HashSet (H.intersection a b)
    {-# INLINABLE intersection #-}
    
    -- | /O(n)/ Reduce this set by applying a binary operator to all
    -- elements, using the given starting value (typically the
    -- left-identity of the operator).  Each application of the operator
    -- is evaluated before before using the result in the next
    -- application.  This function is strict in the starting value.
    foldl' :: (a -> b -> a) -> a -> HashSet b -> a
    foldl' f z0 = H.foldlWithKey' g z0 . asMap
      where g z k _ = f z k
    {-# INLINE foldl' #-}
    
    -- | /O(n)/ Reduce this set by applying a binary operator to all
    -- elements, using the given starting value (typically the
    -- right-identity of the operator).
    foldr :: (b -> a -> a) -> a -> HashSet b -> a
    

    Found in Data.HashSet from the package unordered-containers
    {-# INLINABLE difference #-}
    
    -- | /O(n)/ Intersection of two sets. Return elements present in both
    -- the first set and the second.
    intersection :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
    intersection (HashSet a) (HashSet b) = HashSet (H.intersection a b)
    {-# INLINABLE intersection #-}
    
    -- | /O(n)/ Reduce this set by applying a binary operator to all
    -- elements, using the given starting value (typically the
    -- left-identity of the operator).  Each application of the operator
    -- is evaluated before before using the result in the next
    -- application.  This function is strict in the starting value.
    foldl' :: (a -> b -> a) -> a -> HashSet b -> a
    foldl' f z0 = H.foldlWithKey' g z0 . asMap
      where g z k _ = f z k
    {-# INLINE foldl' #-}
    
    -- | /O(n)/ Reduce this set by applying a binary operator to all
    -- elements, using the given starting value (typically the
    

    Found in Data.HashSet from the package unordered-containers
    difference (HashSet a) (HashSet b) = HashSet (H.difference a b)
    {-# INLINABLE difference #-}
    
    -- | /O(n)/ Intersection of two sets. Return elements present in both
    -- the first set and the second.
    intersection :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
    intersection (HashSet a) (HashSet b) = HashSet (H.intersection a b)
    {-# INLINABLE intersection #-}
    
    -- | /O(n)/ Reduce this set by applying a binary operator to all
    -- elements, using the given starting value (typically the
    -- left-identity of the operator).  Each application of the operator
    -- is evaluated before before using the result in the next
    -- application.  This function is strict in the starting value.
    foldl' :: (a -> b -> a) -> a -> HashSet b -> a
    foldl' f z0 = H.foldlWithKey' g z0 . asMap
      where g z k _ = f z k
    {-# INLINE foldl' #-}
    
    -- | /O(n)/ Reduce this set by applying a binary operator to all
    

    Found in Data.HashSet from the package unordered-containers
    fromMap = HashSet
    
    -- | /O(n+m)/ Construct a set containing all elements from both sets.
    --
    -- To obtain good performance, the smaller set must be presented as
    -- the first argument.
    union :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
    union s1 s2 = HashSet $ H.union (asMap s1) (asMap s2)
    {-# INLINE union #-}
    
    -- TODO: Figure out the time complexity of 'unions'.
    
    -- | Construct a set containing all elements from a list of sets.
    unions :: (Eq a, Hashable a) => [HashSet a] -> HashSet a
    unions = List.foldl' union empty
    {-# INLINE unions #-}
    
    -- | /O(1)/ Return 'True' if this set is empty, 'False' otherwise.
    null :: HashSet a -> Bool
    null = H.null . asMap
    

    Found in Data.HashSet from the package unordered-containers
        , null
        , size
        , member
        , insert
        , delete
    
        -- * Transformations
        , map
    
          -- * Difference and intersection
        , difference
        , intersection
    
        -- * Folds
        , foldl'
        , foldr
    
        -- * Filter
        , filter
    

    foldlWithKey' See 3 Occurences [+] Collapse [-]
    Found in Data.LargeHashable.Class from the package large-hashable
    {-# INLINE updateHashMap #-}
    updateHashMap :: (LargeHashable k, LargeHashable a) => M.Map k a -> LH ()
    updateHashMap !m = do
            M.foldlWithKey' mapFoldFun (return ()) m
            updateHash (M.size m)
    
    -- Lazy and Strict Map share the same definition
    instance (LargeHashable k, LargeHashable a) => LargeHashable (M.Map k a) where
        updateHash = updateHashMap
    
    {-# INLINE updateHashIntMap #-}
    updateHashIntMap :: LargeHashable a => IntMap.IntMap a -> LH ()
    updateHashIntMap !m = do
        IntMap.foldlWithKey' mapFoldFun (return ()) m
        updateHash (IntMap.size m)
    
    -- Lazy and Strict IntMap share the same definition
    instance LargeHashable a => LargeHashable (IntMap.IntMap a) where
        updateHash = updateHashIntMap
    

    Found in Data.LargeHashable.Class from the package large-hashable
        do updateXorHash (map updateHash list)
           updateHash len
    
    -- Lazy and Strict HashSet share the same definition
    instance LargeHashable a => LargeHashable (HashSet.HashSet a) where
        updateHash = updateHashHashSet
    
    {-# INLINE mapFoldFun #-}
    mapFoldFun :: (LargeHashable k, LargeHashable a) => LH () -> k -> a -> LH ()
    mapFoldFun action key value = action >> updateHash key >> updateHash value
    
    {-# INLINE updateHashMap #-}
    updateHashMap :: (LargeHashable k, LargeHashable a) => M.Map k a -> LH ()
    updateHashMap !m = do
            M.foldlWithKey' mapFoldFun (return ()) m
            updateHash (M.size m)
    
    -- Lazy and Strict Map share the same definition
    instance (LargeHashable k, LargeHashable a) => LargeHashable (M.Map k a) where
        updateHash = updateHashMap
    

    Found in Data.HashSet from the package unordered-containers
    {-# INLINABLE difference #-}
    
    -- | /O(n)/ Intersection of two sets. Return elements present in both
    -- the first set and the second.
    intersection :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
    intersection (HashSet a) (HashSet b) = HashSet (H.intersection a b)
    {-# INLINABLE intersection #-}
    
    -- | /O(n)/ Reduce this set by applying a binary operator to all
    -- elements, using the given starting value (typically the
    -- left-identity of the operator).  Each application of the operator
    -- is evaluated before before using the result in the next
    -- application.  This function is strict in the starting value.
    foldl' :: (a -> b -> a) -> a -> HashSet b -> a
    foldl' f z0 = H.foldlWithKey' g z0 . asMap
      where g z k _ = f z k
    {-# INLINE foldl' #-}
    
    -- | /O(n)/ Reduce this set by applying a binary operator to all
    -- elements, using the given starting value (typically the
    

    foldr See 8 Occurences [+] Collapse [-]
    Found in Data.HashSet from the package unordered-containers
    -- left-identity of the operator).  Each application of the operator
    -- is evaluated before before using the result in the next
    -- application.  This function is strict in the starting value.
    foldl' :: (a -> b -> a) -> a -> HashSet b -> a
    foldl' f z0 = H.foldlWithKey' g z0 . asMap
      where g z k _ = f z k
    {-# INLINE foldl' #-}
    
    -- | /O(n)/ Reduce this set by applying a binary operator to all
    -- elements, using the given starting value (typically the
    -- right-identity of the operator).
    foldr :: (b -> a -> a) -> a -> HashSet b -> a
    foldr f z0 = foldrWithKey g z0 . asMap
      where g k _ z = f k z
    {-# INLINE foldr #-}
    
    -- | /O(n)/ Filter this set by retaining only elements satisfying a
    -- predicate.
    filter :: (a -> Bool) -> HashSet a -> HashSet a
    filter p = HashSet . H.filterWithKey q . asMap
    

    Found in Data.HashSet from the package unordered-containers
    -- | /O(n)/ Reduce this set by applying a binary operator to all
    -- elements, using the given starting value (typically the
    -- left-identity of the operator).  Each application of the operator
    -- is evaluated before before using the result in the next
    -- application.  This function is strict in the starting value.
    foldl' :: (a -> b -> a) -> a -> HashSet b -> a
    foldl' f z0 = H.foldlWithKey' g z0 . asMap
      where g z k _ = f z k
    {-# INLINE foldl' #-}
    
    -- | /O(n)/ Reduce this set by applying a binary operator to all
    -- elements, using the given starting value (typically the
    -- right-identity of the operator).
    foldr :: (b -> a -> a) -> a -> HashSet b -> a
    foldr f z0 = foldrWithKey g z0 . asMap
      where g k _ z = f k z
    {-# INLINE foldr #-}
    
    -- | /O(n)/ Filter this set by retaining only elements satisfying a
    -- predicate.
    

    Found in Data.HashSet from the package unordered-containers
    -- | /O(n)/ Reduce this set by applying a binary operator to all
    -- elements, using the given starting value (typically the
    -- left-identity of the operator).  Each application of the operator
    -- is evaluated before before using the result in the next
    -- application.  This function is strict in the starting value.
    foldl' :: (a -> b -> a) -> a -> HashSet b -> a
    foldl' f z0 = H.foldlWithKey' g z0 . asMap
      where g z k _ = f z k
    {-# INLINE foldl' #-}
    
    -- | /O(n)/ Reduce this set by applying a binary operator to all
    -- elements, using the given starting value (typically the
    -- right-identity of the operator).
    foldr :: (b -> a -> a) -> a -> HashSet b -> a
    foldr f z0 = foldrWithKey g z0 . asMap
      where g k _ z = f k z
    {-# INLINE foldr #-}
    
    -- | /O(n)/ Filter this set by retaining only elements satisfying a
    

    Found in Data.HashSet from the package unordered-containers
        liftEq eq (HashSet a) (HashSet b) = equalKeys eq a b
    #endif
    
    instance (Ord a) => Ord (HashSet a) where
        compare (HashSet a) (HashSet b) = compare a b
        {-# INLINE compare #-}
    
    #if MIN_VERSION_base(4,9,0)
    instance Ord1 HashSet where
        liftCompare c (HashSet a) (HashSet b) = liftCompare2 c compare a b
    #endif
    
    instance Foldable.Foldable HashSet where
        foldr = Data.HashSet.foldr
        {-# INLINE foldr #-}
    
    #if __GLASGOW_HASKELL__ >= 711
    instance (Hashable a, Eq a) => Semigroup (HashSet a) where
        (<>) = union
        {-# INLINE (<>) #-}
    

    Found in Data.HashSet from the package unordered-containers
    instance Eq1 HashSet where
        liftEq eq (HashSet a) (HashSet b) = equalKeys eq a b
    #endif
    
    instance (Ord a) => Ord (HashSet a) where
        compare (HashSet a) (HashSet b) = compare a b
        {-# INLINE compare #-}
    
    #if MIN_VERSION_base(4,9,0)
    instance Ord1 HashSet where
        liftCompare c (HashSet a) (HashSet b) = liftCompare2 c compare a b
    #endif
    
    instance Foldable.Foldable HashSet where
        foldr = Data.HashSet.foldr
        {-# INLINE foldr #-}
    
    #if __GLASGOW_HASKELL__ >= 711
    instance (Hashable a, Eq a) => Semigroup (HashSet a) where
        (<>) = union
    

    Found in Data.HashSet from the package unordered-containers
    instance Eq1 HashSet where
        liftEq eq (HashSet a) (HashSet b) = equalKeys eq a b
    #endif
    
    instance (Ord a) => Ord (HashSet a) where
        compare (HashSet a) (HashSet b) = compare a b
        {-# INLINE compare #-}
    
    #if MIN_VERSION_base(4,9,0)
    instance Ord1 HashSet where
        liftCompare c (HashSet a) (HashSet b) = liftCompare2 c compare a b
    #endif
    
    instance Foldable.Foldable HashSet where
        foldr = Data.HashSet.foldr
        {-# INLINE foldr #-}
    
    #if __GLASGOW_HASKELL__ >= 711
    instance (Hashable a, Eq a) => Semigroup (HashSet a) where
        (<>) = union
    

    Found in Data.HashSet from the package unordered-containers
        , toMap
        , fromMap
        ) where
    
    import Control.DeepSeq (NFData(..))
    import Data.Data hiding (Typeable)
    import Data.HashMap.Base (HashMap, foldrWithKey, equalKeys)
    import Data.Hashable (Hashable(hashWithSalt))
    #if __GLASGOW_HASKELL__ >= 711
    import Data.Semigroup (Semigroup(..))
    #elif __GLASGOW_HASKELL__ < 709
    import Data.Monoid (Monoid(..))
    #endif
    import GHC.Exts (build)
    import Prelude hiding (filter, foldr, map, null)
    import qualified Data.Foldable as Foldable
    import qualified Data.HashMap.Lazy as H
    import qualified Data.List as List
    import Data.Typeable (Typeable)
    import Text.Read
    

    Found in Data.HashSet from the package unordered-containers
        , size
        , member
        , insert
        , delete
    
        -- * Transformations
        , map
    
          -- * Difference and intersection
        , difference
        , intersection
    
        -- * Folds
        , foldl'
        , foldr
    
        -- * Filter
        , filter
    
        -- * Conversions
    

    foldrWithKey See 6 Occurences [+] Collapse [-]
    Found in Data.Configurator from the package configurator
    localPattern :: Name -> Pattern -> Pattern
    localPattern pfx (Exact  s) = Exact  (pfx `T.append` s)
    localPattern pfx (Prefix s) = Prefix (pfx `T.append` s)
    
    notifySubscribers :: BaseConfig -> H.HashMap Name Value -> H.HashMap Name Value
                      -> H.HashMap Pattern [ChangeHandler] -> IO ()
    notifySubscribers BaseConfig{..} m m' subs = H.foldrWithKey go (return ()) subs
     where
      changedOrGone = H.foldrWithKey check [] m
          where check n v nvs = case H.lookup n m' of
                                  Just v' | v /= v'   -> (n,Just v'):nvs
                                          | otherwise -> nvs
                                  _                   -> (n,Nothing):nvs
      new = H.foldrWithKey check [] m'
          where check n v nvs = case H.lookup n m of
                                  Nothing -> (n,v):nvs
                                  _       -> nvs
      notify p n v a = a n v `E.catch` maybe report onError cfgAuto
        where report e = hPutStrLn stderr $
    

    Found in Data.Configurator from the package configurator
    subscribe :: Config -> Pattern -> ChangeHandler -> IO ()
    subscribe (Config root BaseConfig{..}) pat act = do
      m' <- atomicModifyIORef cfgSubs $ \m ->
            let m' = H.insertWith (++) (localPattern root pat) [act] m in (m', m')
      evaluate m' >> return ()
    
    localPattern :: Name -> Pattern -> Pattern
    localPattern pfx (Exact  s) = Exact  (pfx `T.append` s)
    localPattern pfx (Prefix s) = Prefix (pfx `T.append` s)
    
    notifySubscribers :: BaseConfig -> H.HashMap Name Value -> H.HashMap Name Value
                      -> H.HashMap Pattern [ChangeHandler] -> IO ()
    notifySubscribers BaseConfig{..} m m' subs = H.foldrWithKey go (return ()) subs
     where
      changedOrGone = H.foldrWithKey check [] m
          where check n v nvs = case H.lookup n m' of
                                  Just v' | v /= v'   -> (n,Just v'):nvs
                                          | otherwise -> nvs
                                  _                   -> (n,Nothing):nvs
      new = H.foldrWithKey check [] m'
    

    Found in Data.Configurator from the package configurator
    -- when any change occurs to a configuration property matching the
    -- supplied pattern.
    subscribe :: Config -> Pattern -> ChangeHandler -> IO ()
    subscribe (Config root BaseConfig{..}) pat act = do
      m' <- atomicModifyIORef cfgSubs $ \m ->
            let m' = H.insertWith (++) (localPattern root pat) [act] m in (m', m')
      evaluate m' >> return ()
    
    localPattern :: Name -> Pattern -> Pattern
    localPattern pfx (Exact  s) = Exact  (pfx `T.append` s)
    localPattern pfx (Prefix s) = Prefix (pfx `T.append` s)
    
    notifySubscribers :: BaseConfig -> H.HashMap Name Value -> H.HashMap Name Value
                      -> H.HashMap Pattern [ChangeHandler] -> IO ()
    notifySubscribers BaseConfig{..} m m' subs = H.foldrWithKey go (return ()) subs
     where
      changedOrGone = H.foldrWithKey check [] m
          where check n v nvs = case H.lookup n m' of
                                  Just v' | v /= v'   -> (n,Just v'):nvs
                                          | otherwise -> nvs
    

    Found in Data.HashSet from the package unordered-containers
    foldr f z0 = foldrWithKey g z0 . asMap
      where g k _ z = f k z
    {-# INLINE foldr #-}
    
    -- | /O(n)/ Filter this set by retaining only elements satisfying a
    -- predicate.
    filter :: (a -> Bool) -> HashSet a -> HashSet a
    filter p = HashSet . H.filterWithKey q . asMap
      where q k _ = p k
    {-# INLINE filter #-}
    
    -- | /O(n)/ Return a list of this set's elements.  The list is
    -- produced lazily.
    toList :: HashSet a -> [a]
    toList t = build (\ c z -> foldrWithKey ((const .) c) z (asMap t))
    {-# INLINE toList #-}
    
    -- | /O(n*min(W, n))/ Construct a set from a list of elements.
    fromList :: (Eq a, Hashable a) => [a] -> HashSet a
    fromList = HashSet . List.foldl' (\ m k -> H.insert k () m) H.empty
    

    Found in Data.HashSet from the package unordered-containers
    -- | /O(n)/ Reduce this set by applying a binary operator to all
    -- elements, using the given starting value (typically the
    -- left-identity of the operator).  Each application of the operator
    -- is evaluated before before using the result in the next
    -- application.  This function is strict in the starting value.
    foldl' :: (a -> b -> a) -> a -> HashSet b -> a
    foldl' f z0 = H.foldlWithKey' g z0 . asMap
      where g z k _ = f z k
    {-# INLINE foldl' #-}
    
    -- | /O(n)/ Reduce this set by applying a binary operator to all
    -- elements, using the given starting value (typically the
    -- right-identity of the operator).
    foldr :: (b -> a -> a) -> a -> HashSet b -> a
    foldr f z0 = foldrWithKey g z0 . asMap
      where g k _ z = f k z
    {-# INLINE foldr #-}
    
    -- | /O(n)/ Filter this set by retaining only elements satisfying a
    -- predicate.
    

    Found in Data.HashSet from the package unordered-containers
        -- * Conversions
    
        -- ** Lists
        , toList
        , fromList
    
        -- * HashMaps
        , toMap
        , fromMap
        ) where
    
    import Control.DeepSeq (NFData(..))
    import Data.Data hiding (Typeable)
    import Data.HashMap.Base (HashMap, foldrWithKey, equalKeys)
    import Data.Hashable (Hashable(hashWithSalt))
    #if __GLASGOW_HASKELL__ >= 711
    import Data.Semigroup (Semigroup(..))
    #elif __GLASGOW_HASKELL__ < 709
    import Data.Monoid (Monoid(..))
    

    fromList See 15 Occurences [+] Collapse [-]
    Found in SourceMap from the package sourcemap
    import           Data.ByteString.Lazy.UTF8 (fromString)
    import           Data.ByteString.Builder (Builder(), lazyByteString, toLazyByteString)
    import           Data.Foldable (forM_)
    import qualified Data.HashMap.Lazy as Map
    import           Data.Monoid
    import           Data.List
    import           Data.Maybe
    import           Data.Ord
    import           Data.STRef
    import           Data.Text (Text)
    import           Data.Text.Lazy.Encoding (decodeUtf8)
    
    -- | Generate the JSON from a source mapping.
    generate :: SourceMapping -> Value
    generate SourceMapping{..} = Object (Map.fromList obj) where
      obj = [("version",toJSON version)
            ,("file",toJSON smFile)
            ,("sources",toJSON sources)
            ,("names",toJSON names)
            ,("mappings",toJSON (decodeUtf8 (encodeMappings sources names smMappings)))] ++
    

    Found in Toml.Parser from the package tomland
    tableHeaderP = do
        k <- tableNameP
        toml <- makeToml <$> many keyValP
        pure (k, toml)
      where
        makeToml :: [(Key, AnyValue)] -> TOML
        makeToml kv = TOML (HashMap.fromList kv) mempty
    
    tomlP :: Parser TOML
    tomlP = do
        sc
        kvs    <- many keyValP
        tables <- many tableHeaderP
        pure TOML { tomlPairs  = HashMap.fromList kvs
                  , tomlTables = fromList tables
                  }
    
    ---------------------------------------------------------------------------
    -- Exposed API
    ----------------------------------------------------------------------------
    

    Found in Toml.Parser from the package tomland
    tableHeaderP :: Parser (Key, TOML)
    tableHeaderP = do
        k <- tableNameP
        toml <- makeToml <$> many keyValP
        pure (k, toml)
      where
        makeToml :: [(Key, AnyValue)] -> TOML
        makeToml kv = TOML (HashMap.fromList kv) mempty
    
    tomlP :: Parser TOML
    tomlP = do
        sc
        kvs    <- many keyValP
        tables <- many tableHeaderP
        pure TOML { tomlPairs  = HashMap.fromList kvs
                  , tomlTables = fromList tables
                  }
    
    ---------------------------------------------------------------------------
    -- Exposed API
    

    Found in Toml.Parser from the package tomland
        k <- keyP
        text_ "="
        uval <- valueP
        case typeCheck uval of
            Left err -> fail $ show err
            Right v  -> pure (k, v)
    
    tableHeaderP :: Parser (Key, TOML)
    tableHeaderP = do
        k <- tableNameP
        toml <- makeToml <$> many keyValP
        pure (k, toml)
      where
        makeToml :: [(Key, AnyValue)] -> TOML
        makeToml kv = TOML (HashMap.fromList kv) mempty
    
    tomlP :: Parser TOML
    tomlP = do
        sc
        kvs    <- many keyValP
    

    Found in Toml.Parser from the package tomland
    import Control.Applicative.Combinators (between, count, manyTill, optional, sepEndBy, skipMany)
    import Control.Monad (void)
    import Data.Char (chr, digitToInt, isControl)
    import Data.Fixed (Pico)
    import Data.List (foldl')
    import Data.Semigroup ((<>))
    import Data.Text (Text)
    import Data.Time (LocalTime (..), ZonedTime (..), fromGregorianValid, makeTimeOfDayValid,
                      minutesToTimeZone)
    import Data.Void (Void)
    import Text.Megaparsec (Parsec, parseErrorPretty', try)
    import Text.Megaparsec.Char (alphaNumChar, anyChar, char, digitChar, eol, hexDigitChar, oneOf,
                                 satisfy, space, space1, string, tab)
    
    import Toml.PrefixTree (Key (..), Piece (..), fromList)
    import Toml.Type (AnyValue, DateTime (..), TOML (..), UValue (..), typeCheck)
    
    import qualified Control.Applicative.Combinators.NonEmpty as NC
    import qualified Data.HashMap.Lazy as HashMap
    import qualified Data.Text as Text
    

    Found in Data.HashSet from the package unordered-containers
    -- | /O(n)/ Return a list of this set's elements.  The list is
    -- produced lazily.
    toList :: HashSet a -> [a]
    toList t = build (\ c z -> foldrWithKey ((const .) c) z (asMap t))
    {-# INLINE toList #-}
    
    -- | /O(n*min(W, n))/ Construct a set from a list of elements.
    fromList :: (Eq a, Hashable a) => [a] -> HashSet a
    fromList = HashSet . List.foldl' (\ m k -> H.insert k () m) H.empty
    {-# INLINE fromList #-}
    
    #if __GLASGOW_HASKELL__ >= 708
    instance (Eq a, Hashable a) => Exts.IsList (HashSet a) where
        type Item (HashSet a) = a
        fromList = fromList
        toList   = toList
    #endif
    

    Found in Data.HashSet from the package unordered-containers
    -- | /O(n)/ Return a list of this set's elements.  The list is
    -- produced lazily.
    toList :: HashSet a -> [a]
    toList t = build (\ c z -> foldrWithKey ((const .) c) z (asMap t))
    {-# INLINE toList #-}
    
    -- | /O(n*min(W, n))/ Construct a set from a list of elements.
    fromList :: (Eq a, Hashable a) => [a] -> HashSet a
    fromList = HashSet . List.foldl' (\ m k -> H.insert k () m) H.empty
    {-# INLINE fromList #-}
    
    #if __GLASGOW_HASKELL__ >= 708
    instance (Eq a, Hashable a) => Exts.IsList (HashSet a) where
        type Item (HashSet a) = a
        fromList = fromList
        toList   = toList
    #endif
    

    Found in Data.HashSet from the package unordered-containers
    filter :: (a -> Bool) -> HashSet a -> HashSet a
    filter p = HashSet . H.filterWithKey q . asMap
      where q k _ = p k
    {-# INLINE filter #-}
    
    -- | /O(n)/ Return a list of this set's elements.  The list is
    -- produced lazily.
    toList :: HashSet a -> [a]
    toList t = build (\ c z -> foldrWithKey ((const .) c) z (asMap t))
    {-# INLINE toList #-}
    
    -- | /O(n*min(W, n))/ Construct a set from a list of elements.
    fromList :: (Eq a, Hashable a) => [a] -> HashSet a
    fromList = HashSet . List.foldl' (\ m k -> H.insert k () m) H.empty
    {-# INLINE fromList #-}
    
    #if __GLASGOW_HASKELL__ >= 708
    instance (Eq a, Hashable a) => Exts.IsList (HashSet a) where
        type Item (HashSet a) = a
        fromList = fromList
    

    Found in Data.HashSet from the package unordered-containers
    -- predicate.
    filter :: (a -> Bool) -> HashSet a -> HashSet a
    filter p = HashSet . H.filterWithKey q . asMap
      where q k _ = p k
    {-# INLINE filter #-}
    
    -- | /O(n)/ Return a list of this set's elements.  The list is
    -- produced lazily.
    toList :: HashSet a -> [a]
    toList t = build (\ c z -> foldrWithKey ((const .) c) z (asMap t))
    {-# INLINE toList #-}
    
    -- | /O(n*min(W, n))/ Construct a set from a list of elements.
    fromList :: (Eq a, Hashable a) => [a] -> HashSet a
    fromList = HashSet . List.foldl' (\ m k -> H.insert k () m) H.empty
    {-# INLINE fromList #-}
    
    #if __GLASGOW_HASKELL__ >= 708
    instance (Eq a, Hashable a) => Exts.IsList (HashSet a) where
        type Item (HashSet a) = a
    

    Found in Data.HashSet from the package unordered-containers
    -- | /O(n)/ Filter this set by retaining only elements satisfying a
    -- predicate.
    filter :: (a -> Bool) -> HashSet a -> HashSet a
    filter p = HashSet . H.filterWithKey q . asMap
      where q k _ = p k
    {-# INLINE filter #-}
    
    -- | /O(n)/ Return a list of this set's elements.  The list is
    -- produced lazily.
    toList :: HashSet a -> [a]
    toList t = build (\ c z -> foldrWithKey ((const .) c) z (asMap t))
    {-# INLINE toList #-}
    
    -- | /O(n*min(W, n))/ Construct a set from a list of elements.
    fromList :: (Eq a, Hashable a) => [a] -> HashSet a
    fromList = HashSet . List.foldl' (\ m k -> H.insert k () m) H.empty
    {-# INLINE fromList #-}
    
    #if __GLASGOW_HASKELL__ >= 708
    instance (Eq a, Hashable a) => Exts.IsList (HashSet a) where
    

    Found in Data.HashSet from the package unordered-containers
    -- | /O(log n)/ Add the specified value to this set.
    insert :: (Eq a, Hashable a) => a -> HashSet a -> HashSet a
    insert a = HashSet . H.insert a () . asMap
    {-# INLINABLE insert #-}
    
    -- | /O(log n)/ Remove the specified value from this set if
    -- present.
    delete :: (Eq a, Hashable a) => a -> HashSet a -> HashSet a
    delete a = HashSet . H.delete a . asMap
    {-# INLINABLE delete #-}
    
    -- | /O(n)/ Transform this set by applying a function to every value.
    -- The resulting set may be smaller than the source.
    map :: (Hashable b, Eq b) => (a -> b) -> HashSet a -> HashSet b
    map f = fromList . List.map f . toList
    {-# INLINE map #-}
    
    -- | /O(n)/ Difference of two sets. Return elements of the first set
    -- not existing in the second.
    difference :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
    

    Found in Data.HashSet from the package unordered-containers
    #if MIN_VERSION_base(4,9,0)
    instance Show1 HashSet where
        liftShowsPrec sp sl d m =
            showsUnaryWith (liftShowsPrec sp sl) "fromList" d (toList m)
    #endif
    
    instance (Show a) => Show (HashSet a) where
        showsPrec d m = showParen (d > 10) $
          showString "fromList " . shows (toList m)
    
    instance (Data a, Eq a, Hashable a) => Data (HashSet a) where
        gfoldl f z m   = z fromList `f` toList m
        toConstr _     = fromListConstr
        gunfold k z c  = case constrIndex c of
            1 -> k (z fromList)
            _ -> error "gunfold"
        dataTypeOf _   = hashSetDataType
        dataCast1 f    = gcast1 f
    
    #if MIN_VERSION_hashable(1,2,6)
    

    Found in Data.HashSet from the package unordered-containers
        readListPrec = readListPrecDefault
    
    #if MIN_VERSION_base(4,9,0)
    instance Show1 HashSet where
        liftShowsPrec sp sl d m =
            showsUnaryWith (liftShowsPrec sp sl) "fromList" d (toList m)
    #endif
    
    instance (Show a) => Show (HashSet a) where
        showsPrec d m = showParen (d > 10) $
          showString "fromList " . shows (toList m)
    
    instance (Data a, Eq a, Hashable a) => Data (HashSet a) where
        gfoldl f z m   = z fromList `f` toList m
        toConstr _     = fromListConstr
        gunfold k z c  = case constrIndex c of
            1 -> k (z fromList)
            _ -> error "gunfold"
        dataTypeOf _   = hashSetDataType
    

    Found in Data.HashSet from the package unordered-containers
    instance (Hashable a, Eq a) => Monoid (HashSet a) where
        mempty = empty
        {-# INLINE mempty #-}
    #if __GLASGOW_HASKELL__ >= 711
        mappend = (<>)
    #else
        mappend = union
    #endif
        {-# INLINE mappend #-}
    
    instance (Eq a, Hashable a, Read a) => Read (HashSet a) where
        readPrec = parens $ prec 10 $ do
          Ident "fromList" <- lexP
          xs <- readPrec
          return (fromList xs)
    
        readListPrec = readListPrecDefault
    
    #if MIN_VERSION_base(4,9,0)
    instance Show1 HashSet where
    

    Found in Data.HashSet from the package unordered-containers
        , difference
        , intersection
    
        -- * Folds
        , foldl'
        , foldr
    
        -- * Filter
        , filter
    
        -- * Conversions
    
        -- ** Lists
        , toList
        , fromList
    
        -- * HashMaps
        , toMap
        , fromMap
        ) where
    

    fromListWith No usage example found for this symbol :( Collapse [-]
    insert See 16 Occurences [+] Collapse [-]
    Found in Data.CharSet.Posix.Ascii from the package charset
    import Data.HashMap.Lazy (HashMap)
    import qualified Data.HashMap.Lazy as HashMap
    
    alnum, alpha, ascii, blank, cntrl, digit, graph, print, word, punct, space, upper, lower, xdigit :: CharSet
    alnum = alpha `union` digit
    alpha = lower `union` upper
    ascii = range '\x00' '\x7f'
    blank = fromList " \t"
    cntrl = insert '\x7f' $ range '\x00' '\x1f'
    digit = range '0' '9'
    lower = range 'a' 'z'
    upper = range 'A' 'Z'
    graph = range '\x21' '\x7e'
    print = insert '\x20' graph
    word  = insert '_' alnum
    punct = fromList "-!\"#$%&'()*+,./:;<=>?@[\\]^_`{|}~"
    space = fromList " \t\r\n\v\f"
    xdigit = digit `union` range 'a' 'f' `union` range 'A' 'F'
    
    -- :digit:, etc.
    

    Found in Data.CharSet.Posix.Ascii from the package charset
    import Data.CharSet
    import Data.HashMap.Lazy (HashMap)
    import qualified Data.HashMap.Lazy as HashMap
    
    alnum, alpha, ascii, blank, cntrl, digit, graph, print, word, punct, space, upper, lower, xdigit :: CharSet
    alnum = alpha `union` digit
    alpha = lower `union` upper
    ascii = range '\x00' '\x7f'
    blank = fromList " \t"
    cntrl = insert '\x7f' $ range '\x00' '\x1f'
    digit = range '0' '9'
    lower = range 'a' 'z'
    upper = range 'A' 'Z'
    graph = range '\x21' '\x7e'
    print = insert '\x20' graph
    word  = insert '_' alnum
    punct = fromList "-!\"#$%&'()*+,./:;<=>?@[\\]^_`{|}~"
    space = fromList " \t\r\n\v\f"
    xdigit = digit `union` range 'a' 'f' `union` range 'A' 'F'
    

    Found in Data.CharSet.Posix.Ascii from the package charset
        , alnum, alpha, ascii, blank, cntrl, digit, graph, print, word, punct, space, upper, lower, xdigit
        ) where
    
    import Prelude hiding (print)
    import Data.Char
    import Data.CharSet
    import Data.HashMap.Lazy (HashMap)
    import qualified Data.HashMap.Lazy as HashMap
    
    alnum, alpha, ascii, blank, cntrl, digit, graph, print, word, punct, space, upper, lower, xdigit :: CharSet
    alnum = alpha `union` digit
    alpha = lower `union` upper
    ascii = range '\x00' '\x7f'
    blank = fromList " \t"
    cntrl = insert '\x7f' $ range '\x00' '\x1f'
    digit = range '0' '9'
    lower = range 'a' 'z'
    upper = range 'A' 'Z'
    graph = range '\x21' '\x7e'
    print = insert '\x20' graph
    

    Found in Data.CharSet.Posix.Unicode from the package charset
        ) where
    
    import Prelude hiding (print)
    import Data.Char
    import Data.CharSet
    import qualified Data.CharSet.Unicode.Category as Category
    import qualified Data.CharSet.Unicode.Block as Block
    import Data.HashMap.Lazy (HashMap)
    import qualified Data.HashMap.Lazy as HashMap
    
    alnum, alpha, ascii, blank, cntrl, digit, graph, print, word, punct, space, upper, lower, xdigit :: CharSet
    alnum = alpha `union` digit
    ascii = Block.basicLatin
    alpha = Category.letterAnd
    blank = insert '\t' Category.space
    cntrl = Category.control
    digit = Category.decimalNumber
    lower = Category.lowercaseLetter
    upper = Category.uppercaseLetter
    graph = complement (Category.separator `union` Category.other)
    

    Found in Data.ComposableAssociation.Aeson from the package composable-associations-aeson
    instance (ToJSON obj, KnownSymbol key) => ToJSON (Association key obj) where
      toJSON (Association key obj) = object [keyName .= toJSON obj]
        where keyName = T.pack $ symbolVal key
    
    instance (FromJSON obj, KnownSymbol key) => FromJSON (Association key obj) where
      parseJSON = withObject "Association" $ \v' -> Association proxy <$> (v' .:? key .!= Null >>= parseJSON)
          where proxy = Proxy :: Proxy key
                key = T.pack $ symbolVal proxy
    
    
    -- | Throws a @JsonObjectEncodingException@ if the base value isn't encoded as a JSON object
    instance (ToJSON base, ToJSON obj, KnownSymbol key) => ToJSON (base :<> Association key obj) where
      toJSON (base :<> Association key obj) = Object $ HashMap.insert keyName objJson baseJsonMap
        where keyName = T.pack $ symbolVal key
              baseJsonMap = case toJSON base of (Object jsonObjVal) -> jsonObjVal
                                                notAnObject -> throw $ JsonObjectEncodingException notAnObject
              objJson = toJSON obj
    

    Found in Data.Configurator from the package configurator
    flatten :: [(Name, Worth Path)]
            -> H.HashMap (Worth Path) [Directive]
            -> IO (H.HashMap Name Value)
    flatten roots files = foldM doPath H.empty roots
     where
      doPath m (pfx, f) = case H.lookup f files of
            Nothing -> return m
            Just ds -> foldM (directive pfx (worth f)) m ds
    
      directive pfx _ m (Bind name (String value)) = do
          v <- interpolate pfx value m
          return $! H.insert (T.append pfx name) (String v) m
      directive pfx _ m (Bind name value) =
          return $! H.insert (T.append pfx name) value m
      directive pfx f m (Group name xs) = foldM (directive pfx' f) m xs
          where pfx' = T.concat [pfx, name, "."]
      directive pfx f m (Import path) =
          let f' = relativize f path
          in  case H.lookup (Required (relativize f path)) files of
    

    Found in Data.Configurator from the package configurator
    getMap :: Config -> IO (H.HashMap Name Value)
    getMap = readIORef . cfgMap . baseCfg
    
    flatten :: [(Name, Worth Path)]
            -> H.HashMap (Worth Path) [Directive]
            -> IO (H.HashMap Name Value)
    flatten roots files = foldM doPath H.empty roots
     where
      doPath m (pfx, f) = case H.lookup f files of
            Nothing -> return m
            Just ds -> foldM (directive pfx (worth f)) m ds
    
      directive pfx _ m (Bind name (String value)) = do
          v <- interpolate pfx value m
          return $! H.insert (T.append pfx name) (String v) m
      directive pfx _ m (Bind name value) =
          return $! H.insert (T.append pfx name) value m
      directive pfx f m (Group name xs) = foldM (directive pfx' f) m xs
          where pfx' = T.concat [pfx, name, "."]
      directive pfx f m (Import path) =
    

    Found in Data.Configurator from the package configurator
    import qualified Data.Attoparsec.Text.Lazy as L
    import qualified Data.HashMap.Lazy as H
    import qualified Data.Text as T
    import qualified Data.Text.Lazy as L
    import qualified Data.Text.Lazy.IO as L
    
    loadFiles :: [Worth Path] -> IO (H.HashMap (Worth Path) [Directive])
    loadFiles = foldM go H.empty
     where
       go seen path = do
         let rewrap n = const n <$> path
             wpath = worth path
         path' <- rewrap <$> interpolate "" wpath H.empty
         ds    <- loadOne (T.unpack <$> path')
         let !seen'    = H.insert path ds seen
             notSeen n = not . isJust . H.lookup n $ seen
         foldM go seen' . filter notSeen . importsOf wpath $ ds
    
    -- | Create a 'Config' from the contents of the named files. Throws an
    -- exception on error, such as if files do not exist or contain errors.
    

    Found in Lens.Micro.Platform from the package microlens-platform
    type instance Index   T.Text = Int
    type instance IxValue T.Text = Char
    type instance Index   TL.Text = Int64
    type instance IxValue TL.Text = Char
    
    instance (Eq k, Hashable k) => Ixed (HashMap k a) where
      ix k f m = case HashMap.lookup k m of
         Just v  -> f v <&> \v' -> HashMap.insert k v' m
         Nothing -> pure m
      {-# INLINE ix #-}
    
    instance (Eq k, Hashable k) => At (HashMap k a) where
      at k f m = f mv <&> \r -> case r of
        Nothing -> maybe m (const (HashMap.delete k m)) mv
        Just v' -> HashMap.insert k v' m
        where mv = HashMap.lookup k m
      {-# INLINE at #-}
    
    instance Ixed (Vector.Vector a) where
      ix i f v
    

    Found in Lens.Micro.Platform from the package microlens-platform
    type instance IxValue (Vector.Vector a) = a
    type instance Index   (Prim.Vector a) = Int
    type instance IxValue (Prim.Vector a) = a
    type instance Index   (Storable.Vector a) = Int
    type instance IxValue (Storable.Vector a) = a
    type instance Index   (Unboxed.Vector a) = Int
    type instance IxValue (Unboxed.Vector a) = a
    type instance Index   T.Text = Int
    type instance IxValue T.Text = Char
    type instance Index   TL.Text = Int64
    type instance IxValue TL.Text = Char
    
    instance (Eq k, Hashable k) => Ixed (HashMap k a) where
      ix k f m = case HashMap.lookup k m of
         Just v  -> f v <&> \v' -> HashMap.insert k v' m
         Nothing -> pure m
      {-# INLINE ix #-}
    
    instance (Eq k, Hashable k) => At (HashMap k a) where
      at k f m = f mv <&> \r -> case r of
    

    Found in Data.HashSet from the package unordered-containers
    -- predicate.
    filter :: (a -> Bool) -> HashSet a -> HashSet a
    filter p = HashSet . H.filterWithKey q . asMap
      where q k _ = p k
    {-# INLINE filter #-}
    
    -- | /O(n)/ Return a list of this set's elements.  The list is
    -- produced lazily.
    toList :: HashSet a -> [a]
    toList t = build (\ c z -> foldrWithKey ((const .) c) z (asMap t))
    {-# INLINE toList #-}
    
    -- | /O(n*min(W, n))/ Construct a set from a list of elements.
    fromList :: (Eq a, Hashable a) => [a] -> HashSet a
    fromList = HashSet . List.foldl' (\ m k -> H.insert k () m) H.empty
    {-# INLINE fromList #-}
    
    #if __GLASGOW_HASKELL__ >= 708
    instance (Eq a, Hashable a) => Exts.IsList (HashSet a) where
        type Item (HashSet a) = a
    

    Found in Data.HashSet from the package unordered-containers
    size = H.size . asMap
    {-# INLINE size #-}
    
    -- | /O(log n)/ Return 'True' if the given value is present in this
    -- set, 'False' otherwise.
    member :: (Eq a, Hashable a) => a -> HashSet a -> Bool
    member a s = case H.lookup a (asMap s) of
                   Just _ -> True
                   _      -> False
    {-# INLINABLE member #-}
    
    -- | /O(log n)/ Add the specified value to this set.
    insert :: (Eq a, Hashable a) => a -> HashSet a -> HashSet a
    insert a = HashSet . H.insert a () . asMap
    {-# INLINABLE insert #-}
    
    -- | /O(log n)/ Remove the specified value from this set if
    -- present.
    delete :: (Eq a, Hashable a) => a -> HashSet a -> HashSet a
    delete a = HashSet . H.delete a . asMap
    

    Found in Data.HashSet from the package unordered-containers
    size :: HashSet a -> Int
    size = H.size . asMap
    {-# INLINE size #-}
    
    -- | /O(log n)/ Return 'True' if the given value is present in this
    -- set, 'False' otherwise.
    member :: (Eq a, Hashable a) => a -> HashSet a -> Bool
    member a s = case H.lookup a (asMap s) of
                   Just _ -> True
                   _      -> False
    {-# INLINABLE member #-}
    
    -- | /O(log n)/ Add the specified value to this set.
    insert :: (Eq a, Hashable a) => a -> HashSet a -> HashSet a
    insert a = HashSet . H.insert a () . asMap
    {-# INLINABLE insert #-}
    
    -- | /O(log n)/ Remove the specified value from this set if
    -- present.
    delete :: (Eq a, Hashable a) => a -> HashSet a -> HashSet a
    

    Found in Data.HashSet from the package unordered-containers
    size :: HashSet a -> Int
    size = H.size . asMap
    {-# INLINE size #-}
    
    -- | /O(log n)/ Return 'True' if the given value is present in this
    -- set, 'False' otherwise.
    member :: (Eq a, Hashable a) => a -> HashSet a -> Bool
    member a s = case H.lookup a (asMap s) of
                   Just _ -> True
                   _      -> False
    {-# INLINABLE member #-}
    
    -- | /O(log n)/ Add the specified value to this set.
    insert :: (Eq a, Hashable a) => a -> HashSet a -> HashSet a
    insert a = HashSet . H.insert a () . asMap
    {-# INLINABLE insert #-}
    
    -- | /O(log n)/ Remove the specified value from this set if
    -- present.
    delete :: (Eq a, Hashable a) => a -> HashSet a -> HashSet a
    

    Found in Data.HashSet from the package unordered-containers
    -- | /O(n)/ Return the number of elements in this set.
    size :: HashSet a -> Int
    size = H.size . asMap
    {-# INLINE size #-}
    
    -- | /O(log n)/ Return 'True' if the given value is present in this
    -- set, 'False' otherwise.
    member :: (Eq a, Hashable a) => a -> HashSet a -> Bool
    member a s = case H.lookup a (asMap s) of
                   Just _ -> True
                   _      -> False
    {-# INLINABLE member #-}
    
    -- | /O(log n)/ Add the specified value to this set.
    insert :: (Eq a, Hashable a) => a -> HashSet a -> HashSet a
    insert a = HashSet . H.insert a () . asMap
    {-# INLINABLE insert #-}
    
    -- | /O(log n)/ Remove the specified value from this set if
    -- present.
    

    Found in Data.HashSet from the package unordered-containers
          HashSet
    
        -- * Construction
        , empty
        , singleton
    
        -- * Combine
        , union
        , unions
    
        -- * Basic interface
        , null
        , size
        , member
        , insert
        , delete
    
        -- * Transformations
        , map
    

    insertWith See 1 Occurences [+] Collapse [-]
    Found in Data.Configurator from the package configurator
                p <- evaluate (L.eitherResult $ L.parse topLevel s)
                     `E.catch` \(e::ConfigError) ->
                     throwIO $ case e of
                                 ParseError _ err -> ParseError (worth path) err
                case p of
                  Left err -> throwIO (ParseError (worth path) err)
                  Right ds -> return ds
    
    -- | Subscribe for notifications.  The given action will be invoked
    -- when any change occurs to a configuration property matching the
    -- supplied pattern.
    subscribe :: Config -> Pattern -> ChangeHandler -> IO ()
    subscribe (Config root BaseConfig{..}) pat act = do
      m' <- atomicModifyIORef cfgSubs $ \m ->
            let m' = H.insertWith (++) (localPattern root pat) [act] m in (m', m')
      evaluate m' >> return ()
    
    localPattern :: Name -> Pattern -> Pattern
    localPattern pfx (Exact  s) = Exact  (pfx `T.append` s)
    localPattern pfx (Prefix s) = Prefix (pfx `T.append` s)
    

    intersection See 5 Occurences [+] Collapse [-]
    Found in Data.HashSet from the package unordered-containers
    map :: (Hashable b, Eq b) => (a -> b) -> HashSet a -> HashSet b
    map f = fromList . List.map f . toList
    {-# INLINE map #-}
    
    -- | /O(n)/ Difference of two sets. Return elements of the first set
    -- not existing in the second.
    difference :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
    difference (HashSet a) (HashSet b) = HashSet (H.difference a b)
    {-# INLINABLE difference #-}
    
    -- | /O(n)/ Intersection of two sets. Return elements present in both
    -- the first set and the second.
    intersection :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
    intersection (HashSet a) (HashSet b) = HashSet (H.intersection a b)
    {-# INLINABLE intersection #-}
    
    -- | /O(n)/ Reduce this set by applying a binary operator to all
    -- elements, using the given starting value (typically the
    -- left-identity of the operator).  Each application of the operator
    -- is evaluated before before using the result in the next
    

    Found in Data.HashSet from the package unordered-containers
    -- The resulting set may be smaller than the source.
    map :: (Hashable b, Eq b) => (a -> b) -> HashSet a -> HashSet b
    map f = fromList . List.map f . toList
    {-# INLINE map #-}
    
    -- | /O(n)/ Difference of two sets. Return elements of the first set
    -- not existing in the second.
    difference :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
    difference (HashSet a) (HashSet b) = HashSet (H.difference a b)
    {-# INLINABLE difference #-}
    
    -- | /O(n)/ Intersection of two sets. Return elements present in both
    -- the first set and the second.
    intersection :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
    intersection (HashSet a) (HashSet b) = HashSet (H.intersection a b)
    {-# INLINABLE intersection #-}
    
    -- | /O(n)/ Reduce this set by applying a binary operator to all
    -- elements, using the given starting value (typically the
    -- left-identity of the operator).  Each application of the operator
    

    Found in Data.HashSet from the package unordered-containers
    -- The resulting set may be smaller than the source.
    map :: (Hashable b, Eq b) => (a -> b) -> HashSet a -> HashSet b
    map f = fromList . List.map f . toList
    {-# INLINE map #-}
    
    -- | /O(n)/ Difference of two sets. Return elements of the first set
    -- not existing in the second.
    difference :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
    difference (HashSet a) (HashSet b) = HashSet (H.difference a b)
    {-# INLINABLE difference #-}
    
    -- | /O(n)/ Intersection of two sets. Return elements present in both
    -- the first set and the second.
    intersection :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
    intersection (HashSet a) (HashSet b) = HashSet (H.intersection a b)
    {-# INLINABLE intersection #-}
    
    -- | /O(n)/ Reduce this set by applying a binary operator to all
    -- elements, using the given starting value (typically the
    -- left-identity of the operator).  Each application of the operator
    

    Found in Data.HashSet from the package unordered-containers
    -- | /O(n)/ Transform this set by applying a function to every value.
    -- The resulting set may be smaller than the source.
    map :: (Hashable b, Eq b) => (a -> b) -> HashSet a -> HashSet b
    map f = fromList . List.map f . toList
    {-# INLINE map #-}
    
    -- | /O(n)/ Difference of two sets. Return elements of the first set
    -- not existing in the second.
    difference :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
    difference (HashSet a) (HashSet b) = HashSet (H.difference a b)
    {-# INLINABLE difference #-}
    
    -- | /O(n)/ Intersection of two sets. Return elements present in both
    -- the first set and the second.
    intersection :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
    intersection (HashSet a) (HashSet b) = HashSet (H.intersection a b)
    {-# INLINABLE intersection #-}
    
    -- | /O(n)/ Reduce this set by applying a binary operator to all
    -- elements, using the given starting value (typically the
    

    Found in Data.HashSet from the package unordered-containers
        , unions
    
        -- * Basic interface
        , null
        , size
        , member
        , insert
        , delete
    
        -- * Transformations
        , map
    
          -- * Difference and intersection
        , difference
        , intersection
    
        -- * Folds
        , foldl'
        , foldr
    

    intersectionWith See 4 Occurences [+] Collapse [-]
    Found in Algebra.PartialOrd from the package lattices
    instance PartialOrd IS.IntSet where
        leq = IS.isSubsetOf
    
    instance (Eq k, Hashable k) => PartialOrd (HS.HashSet k) where
        leq a b = HS.null (HS.difference a b)
    
    instance (Ord k, PartialOrd v) => PartialOrd (M.Map k v) where
        leq = M.isSubmapOfBy leq
    
    instance PartialOrd v => PartialOrd (IM.IntMap v) where
        leq = IM.isSubmapOfBy leq
    
    instance (Eq k, Hashable k, PartialOrd v) => PartialOrd (HM.HashMap k v) where
        x `leq` y = {- wish: HM.isSubmapOfBy leq -}
            HM.null (HM.difference x y) && getAll (fold $ HM.intersectionWith (\vx vy -> All (vx `leq` vy)) x y)
    
    instance (PartialOrd a, PartialOrd b) => PartialOrd (a, b) where
        -- NB: *not* a lexical ordering. This is because for some component partial orders, lexical
        -- ordering is incompatible with the transitivity axiom we require for the derived partial order
        (x1, y1) `leq` (x2, y2) = x1 `leq` x2 && y1 `leq` y2
    

    Found in Linear.Vector from the package linear
    instance Ord k => Additive (Map k) where
      zero = Map.empty
      {-# INLINE zero #-}
      liftU2 = Map.unionWith
      {-# INLINE liftU2 #-}
      liftI2 = Map.intersectionWith
      {-# INLINE liftI2 #-}
    
    instance (Eq k, Hashable k) => Additive (HashMap k) where
      zero = HashMap.empty
      {-# INLINE zero #-}
      liftU2 = HashMap.unionWith
      {-# INLINE liftU2 #-}
      liftI2 = HashMap.intersectionWith
      {-# INLINE liftI2 #-}
    
    instance Additive ((->) b) where
      zero   = const 0
      {-# INLINE zero #-}
    

    Found in Linear.Vector from the package linear
    instance Additive IntMap where
      zero = IntMap.empty
      {-# INLINE zero #-}
      liftU2 = IntMap.unionWith
      {-# INLINE liftU2 #-}
      liftI2 = IntMap.intersectionWith
      {-# INLINE liftI2 #-}
    
    instance Ord k => Additive (Map k) where
      zero = Map.empty
      {-# INLINE zero #-}
      liftU2 = Map.unionWith
      {-# INLINE liftU2 #-}
      liftI2 = Map.intersectionWith
      {-# INLINE liftI2 #-}
    
    instance (Eq k, Hashable k) => Additive (HashMap k) where
      zero = HashMap.empty
      {-# INLINE zero #-}
    

    Found in Linear.Vector from the package linear
      {-# INLINE zero #-}
      liftU2 f = go where
        go (x:xs) (y:ys) = f x y : go xs ys
        go [] ys = ys
        go xs [] = xs
      {-# INLINE liftU2 #-}
      liftI2 = Prelude.zipWith
      {-# INLINE liftI2 #-}
    
    instance Additive IntMap where
      zero = IntMap.empty
      {-# INLINE zero #-}
      liftU2 = IntMap.unionWith
      {-# INLINE liftU2 #-}
      liftI2 = IntMap.intersectionWith
      {-# INLINE liftI2 #-}
    
    instance Ord k => Additive (Map k) where
      zero = Map.empty
      {-# INLINE zero #-}
    

    intersectionWithKey No usage example found for this symbol :( Collapse [-]
    keys See 6 Occurences [+] Collapse [-]
    Found in Control.Concurrent.STM.TMapChan.Hash from the package tmapchan
        forM_ as' (writeTChan c)
      modifyTVar' xs (HashMap.insert k c)
    
    -- | Clones all the content from every channel, and inserts the unique subset of them to `k`, in an unspecified order.
    cloneAllUniquely :: ( Eq k, Hashable k
                        , Eq a, Hashable a
                        )
                      => TMapChan k a
                      -> k
                      -> STM ()
    cloneAllUniquely t@(TMapChan xs) k = do
      as <- readTVar xs
      c <- newTChan
      as' <- newTVar HashSet.empty
      forM_ (HashMap.keys as) $ \k' -> do
        as'More <- HashSet.fromList <$> observeAll t k'
        modifyTVar' as' (HashSet.union as'More)
      as'All <- HashSet.toList <$> readTVar as'
      forM_ as'All (writeTChan c)
      modifyTVar' xs (HashMap.insert k c)
    

    Found in Control.Concurrent.STM.TMapChan.Hash from the package tmapchan
            -> k -- ^ key to clone /from/
            -> k -- ^ key to clone /to/
            -> STM ()
    cloneAt t@(TMapChan xs) kFrom kTo = do
      as <- observeAll t kFrom
      c <- newTChan
      forM_ as (writeTChan c)
      modifyTVar' xs (HashMap.insert kTo c)
    
    -- | Clones all the content for every key, by the key.
    cloneAll :: (Eq k, Hashable k) => TMapChan k a -> k -> STM ()
    cloneAll t@(TMapChan xs) k = do
      as <- readTVar xs
      c <- newTChan
      forM_ (HashMap.keys as) $ \k' -> do
        as' <- observeAll t k'
        forM_ as' (writeTChan c)
      modifyTVar' xs (HashMap.insert k c)
    
    -- | Clones all the content from every channel, and inserts the unique subset of them to `k`, in an unspecified order.
    

    Found in Control.Concurrent.STM.TMapChan.Hash from the package tmapchan
      xs <- readTVar t
      case HashMap.lookup k xs of
        Nothing -> do
          c' <- newTChan
          writeTVar t (HashMap.insert k c' xs)
          pure c'
        Just c' -> pure c'
    
    setTChan :: (Eq k, Hashable k) => TMapChan k a -> k -> TChan a -> STM ()
    setTChan (TMapChan t) k c = modifyTVar' t (HashMap.insert k c)
    
    
    broadcast :: (Eq k, Hashable k) => TMapChan k a -> a -> STM ()
    broadcast t@(TMapChan xs) a = do
      ks <- HashMap.keys <$> readTVar xs
      forM_ ks (\k -> insert t k a)
    
    
    cloneAt :: (Eq k, Hashable k)
            => TMapChan k a
    

    Found in Control.Concurrent.STM.TMapChan.Hash from the package tmapchan
    -- | Deletes the /next/ element in the map, if it exists. Doesn't block.
    delete :: (Eq k, Hashable k) => TMapChan k a -> k -> STM ()
    delete t k = void (tryLookup t k)
    
    -- | Clears the queue at the key
    deleteAll :: (Eq k, Hashable k) => TMapChan k a -> k -> STM ()
    deleteAll t k = void (lookupAll t k)
    
    
    -- * Utils
    
    keys :: TMapChan k a -> STM [k]
    keys (TMapChan m) = HashMap.keys <$> readTVar m
    
    
    -- | Creates a new one if it doesn't already exist
    getTChan :: (Eq k, Hashable k) => TMapChan k a -> k -> STM (TChan a)
    getTChan (TMapChan t) k = do
    

    Found in Control.Concurrent.STM.TMapChan.Hash from the package tmapchan
    -- | Deletes the /next/ element in the map, if it exists. Doesn't block.
    delete :: (Eq k, Hashable k) => TMapChan k a -> k -> STM ()
    delete t k = void (tryLookup t k)
    
    -- | Clears the queue at the key
    deleteAll :: (Eq k, Hashable k) => TMapChan k a -> k -> STM ()
    deleteAll t k = void (lookupAll t k)
    
    
    -- * Utils
    
    keys :: TMapChan k a -> STM [k]
    keys (TMapChan m) = HashMap.keys <$> readTVar m
    
    
    -- | Creates a new one if it doesn't already exist
    getTChan :: (Eq k, Hashable k) => TMapChan k a -> k -> STM (TChan a)
    getTChan (TMapChan t) k = do
    

    Found in Control.Concurrent.STM.TMapChan.Hash from the package tmapchan
        Just next -> (:) next <$> observeAll t k
    
    
    -- | Deletes the /next/ element in the map, if it exists. Doesn't block.
    delete :: (Eq k, Hashable k) => TMapChan k a -> k -> STM ()
    delete t k = void (tryLookup t k)
    
    -- | Clears the queue at the key
    deleteAll :: (Eq k, Hashable k) => TMapChan k a -> k -> STM ()
    deleteAll t k = void (lookupAll t k)
    
    
    -- * Utils
    
    keys :: TMapChan k a -> STM [k]
    keys (TMapChan m) = HashMap.keys <$> readTVar m
    
    
    -- | Creates a new one if it doesn't already exist
    getTChan :: (Eq k, Hashable k) => TMapChan k a -> k -> STM (TChan a)
    

    lookup See 23 Occurences [+] Collapse [-]
    Found in Data.CharSet.Posix.Ascii from the package charset
        , ("blank", blank)
        , ("cntrl", cntrl)
        , ("digit", digit)
        , ("graph", graph)
        , ("print", print)
        , ("word",  word)
        , ("punct", punct)
        , ("space", space)
        , ("upper", upper)
        , ("lower", lower)
        , ("xdigit", xdigit)
        ]
    
    lookupPosixAsciiCharSet :: String -> Maybe CharSet
    lookupPosixAsciiCharSet s = HashMap.lookup (Prelude.map toLower s) posixAscii
    

    Found in Data.CharSet.Posix.Unicode from the package charset
        , ("blank", blank)
        , ("cntrl", cntrl)
        , ("digit", digit)
        , ("graph", graph)
        , ("print", print)
        , ("word",  word)
        , ("punct", punct)
        , ("space", space)
        , ("upper", upper)
        , ("lower", lower)
        , ("xdigit", xdigit)
        ]
    
    lookupPosixUnicodeCharSet :: String -> Maybe CharSet
    lookupPosixUnicodeCharSet s = HashMap.lookup (Prelude.map toLower s) posixUnicode
    

    Found in Data.CharSet.Unicode.Block from the package charset
                  blocks
    
    canonicalize :: String -> String
    canonicalize s = case Prelude.map toLower s of
        'i': 'n' : xs -> go xs
        xs -> go xs
        where
            go ('-':xs) = go xs
            go ('_':xs) = go xs
            go (' ':xs) = go xs
            go (x:xs) = x : go xs
            go [] = []
    
    lookupBlock :: String -> Maybe Block
    lookupBlock s = HashMap.lookup (canonicalize s) lookupTable
    
    lookupBlockCharSet :: String -> Maybe CharSet
    lookupBlockCharSet = fmap blockCharSet . lookupBlock
    
    basicLatin = range '\x0000' '\x007f'
    

    Found in Data.CharSet.Unicode.Category from the package charset
        ,     Category "Control" "Cc" control "an ASCII 0x00..0x1F or Latin-1 0x80..0x9F control character"
        ,     Category "Format" "Cf" format "invisible formatting indicator"
        ,     Category "Private_Use" "Co" privateUse "any code point reserved for private use"
        ,     Category "Surrogate" "Cs" surrogate "one half of a surrogate pair in UTF-16 encoding"
        ,     Category "Unassigned" "Cn" notAssigned "any code point to which no character has been assigned.properties" ]
    
    lookupTable :: HashMap String Category
    lookupTable = HashMap.fromList
      [ (canonicalize x, category)
      | category@(Category l s _ _) <- categories
      , x <- [l,s]
      ]
    
    lookupCategory :: String -> Maybe Category
    lookupCategory s = HashMap.lookup (canonicalize s) lookupTable
    
    lookupCategoryCharSet :: String -> Maybe CharSet
    lookupCategoryCharSet = fmap categoryCharSet . lookupCategory
    
    canonicalize :: String -> String
    

    Found in Data.Configurator from the package configurator
          where check n v nvs = case H.lookup n m' of
                                  Just v' | v /= v'   -> (n,Just v'):nvs
                                          | otherwise -> nvs
                                  _                   -> (n,Nothing):nvs
      new = H.foldrWithKey check [] m'
          where check n v nvs = case H.lookup n m of
                                  Nothing -> (n,v):nvs
                                  _       -> nvs
      notify p n v a = a n v `E.catch` maybe report onError cfgAuto
        where report e = hPutStrLn stderr $
                         "*** a ChangeHandler threw an exception for " ++
                         show (p,n) ++ ": " ++ show e
      go p@(Exact n) acts next = (const next =<<) $ do
        let v' = H.lookup n m'
        when (H.lookup n m /= v') . mapM_ (notify p n v') $ acts
      go p@(Prefix n) acts next = (const next =<<) $ do
        let matching = filter (T.isPrefixOf n . fst)
        forM_ (matching new) $ \(n',v) -> mapM_ (notify p n' (Just v)) acts
        forM_ (matching changedOrGone) $ \(n',v) -> mapM_ (notify p n' v) acts
    

    Found in Data.Configurator from the package configurator
      changedOrGone = H.foldrWithKey check [] m
          where check n v nvs = case H.lookup n m' of
                                  Just v' | v /= v'   -> (n,Just v'):nvs
                                          | otherwise -> nvs
                                  _                   -> (n,Nothing):nvs
      new = H.foldrWithKey check [] m'
          where check n v nvs = case H.lookup n m of
                                  Nothing -> (n,v):nvs
                                  _       -> nvs
      notify p n v a = a n v `E.catch` maybe report onError cfgAuto
        where report e = hPutStrLn stderr $
                         "*** a ChangeHandler threw an exception for " ++
                         show (p,n) ++ ": " ++ show e
      go p@(Exact n) acts next = (const next =<<) $ do
        let v' = H.lookup n m'
        when (H.lookup n m /= v') . mapM_ (notify p n v') $ acts
      go p@(Prefix n) acts next = (const next =<<) $ do
        let matching = filter (T.isPrefixOf n . fst)
        forM_ (matching new) $ \(n',v) -> mapM_ (notify p n' (Just v)) acts
        forM_ (matching changedOrGone) $ \(n',v) -> mapM_ (notify p n' v) acts
    

    Found in Data.Configurator from the package configurator
    localPattern :: Name -> Pattern -> Pattern
    localPattern pfx (Exact  s) = Exact  (pfx `T.append` s)
    localPattern pfx (Prefix s) = Prefix (pfx `T.append` s)
    
    notifySubscribers :: BaseConfig -> H.HashMap Name Value -> H.HashMap Name Value
                      -> H.HashMap Pattern [ChangeHandler] -> IO ()
    notifySubscribers BaseConfig{..} m m' subs = H.foldrWithKey go (return ()) subs
     where
      changedOrGone = H.foldrWithKey check [] m
          where check n v nvs = case H.lookup n m' of
                                  Just v' | v /= v'   -> (n,Just v'):nvs
                                          | otherwise -> nvs
                                  _                   -> (n,Nothing):nvs
      new = H.foldrWithKey check [] m'
          where check n v nvs = case H.lookup n m of
                                  Nothing -> (n,v):nvs
                                  _       -> nvs
      notify p n v a = a n v `E.catch` maybe report onError cfgAuto
        where report e = hPutStrLn stderr $
                         "*** a ChangeHandler threw an exception for " ++
    

    Found in Data.Configurator from the package configurator
    subscribe (Config root BaseConfig{..}) pat act = do
      m' <- atomicModifyIORef cfgSubs $ \m ->
            let m' = H.insertWith (++) (localPattern root pat) [act] m in (m', m')
      evaluate m' >> return ()
    
    localPattern :: Name -> Pattern -> Pattern
    localPattern pfx (Exact  s) = Exact  (pfx `T.append` s)
    localPattern pfx (Prefix s) = Prefix (pfx `T.append` s)
    
    notifySubscribers :: BaseConfig -> H.HashMap Name Value -> H.HashMap Name Value
                      -> H.HashMap Pattern [ChangeHandler] -> IO ()
    notifySubscribers BaseConfig{..} m m' subs = H.foldrWithKey go (return ()) subs
     where
      changedOrGone = H.foldrWithKey check [] m
          where check n v nvs = case H.lookup n m' of
                                  Just v' | v /= v'   -> (n,Just v'):nvs
                                          | otherwise -> nvs
                                  _                   -> (n,Nothing):nvs
      new = H.foldrWithKey check [] m'
          where check n v nvs = case H.lookup n m of
    

    Found in Data.Configurator from the package configurator
      directive pfx f m (Import path) =
          let f' = relativize f path
          in  case H.lookup (Required (relativize f path)) files of
                Just ds -> foldM (directive pfx f') m ds
                _       -> return m
    
    interpolate :: T.Text -> T.Text -> H.HashMap Name Value -> IO T.Text
    interpolate pfx s env
        | "$" `T.isInfixOf` s =
          case T.parseOnly interp s of
            Left err   -> throwIO $ ParseError "" err
            Right xs -> (L.toStrict . toLazyText . mconcat) <$> mapM interpret xs
        | otherwise = return s
     where
      lookupEnv name = msum $ map (flip H.lookup env) fullnames
        where fullnames = map (T.intercalate ".")     -- ["a.b.c.x","a.b.x","a.x","x"]
                        . map (reverse . (name:)) -- [["a","b","c","x"],["a","b","x"],["a","x"],["x"]]
                        . tails                   -- [["c","b","a"],["b","a"],["a"],[]]
                        . reverse                 -- ["c","b","a"]
                        . filter (not . T.null)   -- ["a","b","c"]
    

    Found in Data.Configurator from the package configurator
     where
      doPath m (pfx, f) = case H.lookup f files of
            Nothing -> return m
            Just ds -> foldM (directive pfx (worth f)) m ds
    
      directive pfx _ m (Bind name (String value)) = do
          v <- interpolate pfx value m
          return $! H.insert (T.append pfx name) (String v) m
      directive pfx _ m (Bind name value) =
          return $! H.insert (T.append pfx name) value m
      directive pfx f m (Group name xs) = foldM (directive pfx' f) m xs
          where pfx' = T.concat [pfx, name, "."]
      directive pfx f m (Import path) =
          let f' = relativize f path
          in  case H.lookup (Required (relativize f path)) files of
                Just ds -> foldM (directive pfx f') m ds
                _       -> return m
    
    interpolate :: T.Text -> T.Text -> H.HashMap Name Value -> IO T.Text
    interpolate pfx s env
    

    Found in Data.Configurator from the package configurator
    -- | Perform a simple dump of a 'Config' to @stdout@.
    display :: Config -> IO ()
    display (Config root BaseConfig{..}) = print . (root,) =<< readIORef cfgMap
    
    -- | Fetch the 'H.HashMap' that maps names to values.
    getMap :: Config -> IO (H.HashMap Name Value)
    getMap = readIORef . cfgMap . baseCfg
    
    flatten :: [(Name, Worth Path)]
            -> H.HashMap (Worth Path) [Directive]
            -> IO (H.HashMap Name Value)
    flatten roots files = foldM doPath H.empty roots
     where
      doPath m (pfx, f) = case H.lookup f files of
            Nothing -> return m
            Just ds -> foldM (directive pfx (worth f)) m ds
    
      directive pfx _ m (Bind name (String value)) = do
          v <- interpolate pfx value m
    

    Found in Data.Configurator from the package configurator
    require cfg name = do
      val <- lookup cfg name
      case val of
        Just v -> return v
        _      -> throwIO . KeyError $ name
    
    -- | Look up a name in the given 'Config'.  If a binding exists, and
    -- the value can be converted to the desired type, return it,
    -- otherwise return the default value.
    lookupDefault :: Configured a =>
                     a
                  -- ^ Default value to return if 'lookup' or 'convert'
                  -- fails.
                  -> Config -> Name -> IO a
    lookupDefault def cfg name = fromMaybe def <$> lookup cfg name
    
    -- | Perform a simple dump of a 'Config' to @stdout@.
    display :: Config -> IO ()
    display (Config root BaseConfig{..}) = print . (root,) =<< readIORef cfgMap
    

    Found in Data.Configurator from the package configurator
         return (fileSize st, modificationTime st)
    
    -- | Look up a name in the given 'Config'.  If a binding exists, and
    -- the value can be 'convert'ed to the desired type, return the
    -- converted value, otherwise 'Nothing'.
    lookup :: Configured a => Config -> Name -> IO (Maybe a)
    lookup (Config root BaseConfig{..}) name =
        (join . fmap convert . H.lookup (root `T.append` name)) <$> readIORef cfgMap
    
    -- | Look up a name in the given 'Config'.  If a binding exists, and
    -- the value can be 'convert'ed to the desired type, return the
    -- converted value, otherwise throw a 'KeyError'.
    require :: Configured a => Config -> Name -> IO a
    require cfg name = do
      val <- lookup cfg name
      case val of
        Just v -> return v
        _      -> throwIO . KeyError $ name
    
    -- | Look up a name in the given 'Config'.  If a binding exists, and
    

    Found in Data.Configurator from the package configurator
    -- filesystem with timestamp resolution of 1 second or worse.
    type Meta = (FileOffset, EpochTime)
    
    getMeta :: [Worth FilePath] -> IO [Maybe Meta]
    getMeta paths = forM paths $ \path ->
       handle (\(_::SomeException) -> return Nothing) . fmap Just $ do
         st <- getFileStatus (worth path)
         return (fileSize st, modificationTime st)
    
    -- | Look up a name in the given 'Config'.  If a binding exists, and
    -- the value can be 'convert'ed to the desired type, return the
    -- converted value, otherwise 'Nothing'.
    lookup :: Configured a => Config -> Name -> IO (Maybe a)
    lookup (Config root BaseConfig{..}) name =
        (join . fmap convert . H.lookup (root `T.append` name)) <$> readIORef cfgMap
    
    -- | Look up a name in the given 'Config'.  If a binding exists, and
    -- the value can be 'convert'ed to the desired type, return the
    -- converted value, otherwise throw a 'KeyError'.
    require :: Configured a => Config -> Name -> IO a
    

    Found in Data.Configurator from the package configurator
    -- have a better chance of detecting a modification on a crappy
    -- filesystem with timestamp resolution of 1 second or worse.
    type Meta = (FileOffset, EpochTime)
    
    getMeta :: [Worth FilePath] -> IO [Maybe Meta]
    getMeta paths = forM paths $ \path ->
       handle (\(_::SomeException) -> return Nothing) . fmap Just $ do
         st <- getFileStatus (worth path)
         return (fileSize st, modificationTime st)
    
    -- | Look up a name in the given 'Config'.  If a binding exists, and
    -- the value can be 'convert'ed to the desired type, return the
    -- converted value, otherwise 'Nothing'.
    lookup :: Configured a => Config -> Name -> IO (Maybe a)
    lookup (Config root BaseConfig{..}) name =
        (join . fmap convert . H.lookup (root `T.append` name)) <$> readIORef cfgMap
    
    -- | Look up a name in the given 'Config'.  If a binding exists, and
    -- the value can be 'convert'ed to the desired type, return the
    -- converted value, otherwise throw a 'KeyError'.
    

    Found in Data.Configurator from the package configurator
    -- | Save both a file's size and its last modification date, so we
    -- have a better chance of detecting a modification on a crappy
    -- filesystem with timestamp resolution of 1 second or worse.
    type Meta = (FileOffset, EpochTime)
    
    getMeta :: [Worth FilePath] -> IO [Maybe Meta]
    getMeta paths = forM paths $ \path ->
       handle (\(_::SomeException) -> return Nothing) . fmap Just $ do
         st <- getFileStatus (worth path)
         return (fileSize st, modificationTime st)
    
    -- | Look up a name in the given 'Config'.  If a binding exists, and
    -- the value can be 'convert'ed to the desired type, return the
    -- converted value, otherwise 'Nothing'.
    lookup :: Configured a => Config -> Name -> IO (Maybe a)
    lookup (Config root BaseConfig{..}) name =
        (join . fmap convert . H.lookup (root `T.append` name)) <$> readIORef cfgMap
    
    -- | Look up a name in the given 'Config'.  If a binding exists, and
    -- the value can be 'convert'ed to the desired type, return the
    

    Found in Data.Configurator from the package configurator
    import qualified Data.HashMap.Lazy as H
    import qualified Data.Text as T
    import qualified Data.Text.Lazy as L
    import qualified Data.Text.Lazy.IO as L
    
    loadFiles :: [Worth Path] -> IO (H.HashMap (Worth Path) [Directive])
    loadFiles = foldM go H.empty
     where
       go seen path = do
         let rewrap n = const n <$> path
             wpath = worth path
         path' <- rewrap <$> interpolate "" wpath H.empty
         ds    <- loadOne (T.unpack <$> path')
         let !seen'    = H.insert path ds seen
             notSeen n = not . isJust . H.lookup n $ seen
         foldM go seen' . filter notSeen . importsOf wpath $ ds
    
    -- | Create a 'Config' from the contents of the named files. Throws an
    -- exception on error, such as if files do not exist or contain errors.
    --
    

    Found in Data.Configurator from the package configurator
    import Control.Concurrent (ThreadId, forkIO, threadDelay)
    import Control.Exception (SomeException, evaluate, handle, throwIO, try)
    import Control.Monad (foldM, forM, forM_, join, when, msum)
    import Data.Configurator.Instances ()
    import Data.Configurator.Parser (interp, topLevel)
    import Data.Configurator.Types.Internal
    import Data.IORef (atomicModifyIORef, newIORef, readIORef)
    import Data.List (tails)
    import Data.Maybe (fromMaybe, isJust)
    import Data.Monoid (mconcat)
    import Data.Ratio (denominator, numerator)
    import Data.Text.Lazy.Builder (fromString, fromText, toLazyText)
    import Data.Text.Lazy.Builder.Int (decimal)
    import Data.Text.Lazy.Builder.RealFloat (realFloat)
    import Prelude hiding (lookup)
    import System.Environment (getEnv)
    import System.IO (hPutStrLn, stderr)
    import System.IO.Unsafe (unsafePerformIO)
    import System.Posix.Types (EpochTime, FileOffset)
    import System.PosixCompat.Files (fileSize, getFileStatus, modificationTime)
    

    Found in Data.Configurator from the package configurator
        -- ** Grouping directives
        -- $group
    
        -- ** Importing files
        -- $import
    
        -- * Types
          Worth(..)
        -- * Loading configuration data
        , autoReload
        , autoReloadGroups
        , autoConfig
        , empty
        -- * Lookup functions
        , lookup
        , lookupDefault
        , require
        -- * Notification of configuration changes
        -- $notify
        , prefix
    

    Found in Data.Configurator.Types.Internal from the package configurator
        , exact
        , prefix
        , ChangeHandler
        ) where
    
    import Control.Exception
    import Data.Data (Data)
    import Data.Hashable (Hashable(..))
    import Data.IORef (IORef)
    import Data.List (isSuffixOf)
    import Data.String (IsString(..))
    import Data.Text (Text)
    import qualified Data.Text as T
    import Data.Typeable (Typeable)
    import Prelude hiding (lookup)
    import qualified Data.HashMap.Lazy as H
    
    data Worth a = Required { worth :: a }
                 | Optional { worth :: a }
                   deriving (Show, Typeable)
    

    Found in Lens.Micro.Platform from the package microlens-platform
    type instance IxValue T.Text = Char
    type instance Index   TL.Text = Int64
    type instance IxValue TL.Text = Char
    
    instance (Eq k, Hashable k) => Ixed (HashMap k a) where
      ix k f m = case HashMap.lookup k m of
         Just v  -> f v <&> \v' -> HashMap.insert k v' m
         Nothing -> pure m
      {-# INLINE ix #-}
    
    instance (Eq k, Hashable k) => At (HashMap k a) where
      at k f m = f mv <&> \r -> case r of
        Nothing -> maybe m (const (HashMap.delete k m)) mv
        Just v' -> HashMap.insert k v' m
        where mv = HashMap.lookup k m
      {-# INLINE at #-}
    
    instance Ixed (Vector.Vector a) where
      ix i f v
        | 0 <= i && i < Vector.length v = f (v Vector.! i) <&> \a -> v Vector.// [(i, a)]
    

    Found in Lens.Micro.Platform from the package microlens-platform
    type instance Index   (Vector.Vector a) = Int
    type instance IxValue (Vector.Vector a) = a
    type instance Index   (Prim.Vector a) = Int
    type instance IxValue (Prim.Vector a) = a
    type instance Index   (Storable.Vector a) = Int
    type instance IxValue (Storable.Vector a) = a
    type instance Index   (Unboxed.Vector a) = Int
    type instance IxValue (Unboxed.Vector a) = a
    type instance Index   T.Text = Int
    type instance IxValue T.Text = Char
    type instance Index   TL.Text = Int64
    type instance IxValue TL.Text = Char
    
    instance (Eq k, Hashable k) => Ixed (HashMap k a) where
      ix k f m = case HashMap.lookup k m of
         Just v  -> f v <&> \v' -> HashMap.insert k v' m
         Nothing -> pure m
      {-# INLINE ix #-}
    
    instance (Eq k, Hashable k) => At (HashMap k a) where
    

    Found in Data.HashSet from the package unordered-containers
    -- | /O(1)/ Return 'True' if this set is empty, 'False' otherwise.
    null :: HashSet a -> Bool
    null = H.null . asMap
    {-# INLINE null #-}
    
    -- | /O(n)/ Return the number of elements in this set.
    size :: HashSet a -> Int
    size = H.size . asMap
    {-# INLINE size #-}
    
    -- | /O(log n)/ Return 'True' if the given value is present in this
    -- set, 'False' otherwise.
    member :: (Eq a, Hashable a) => a -> HashSet a -> Bool
    member a s = case H.lookup a (asMap s) of
                   Just _ -> True
                   _      -> False
    {-# INLINABLE member #-}
    
    -- | /O(log n)/ Add the specified value to this set.
    

    lookupDefault See 3 Occurences [+] Collapse [-]
    Found in Data.Configurator from the package configurator
    require cfg name = do
      val <- lookup cfg name
      case val of
        Just v -> return v
        _      -> throwIO . KeyError $ name
    
    -- | Look up a name in the given 'Config'.  If a binding exists, and
    -- the value can be converted to the desired type, return it,
    -- otherwise return the default value.
    lookupDefault :: Configured a =>
                     a
                  -- ^ Default value to return if 'lookup' or 'convert'
                  -- fails.
                  -> Config -> Name -> IO a
    lookupDefault def cfg name = fromMaybe def <$> lookup cfg name
    
    -- | Perform a simple dump of a 'Config' to @stdout@.
    display :: Config -> IO ()
    display (Config root BaseConfig{..}) = print . (root,) =<< readIORef cfgMap
    

    Found in Data.Configurator from the package configurator
    -- | Look up a name in the given 'Config'.  If a binding exists, and
    -- the value can be 'convert'ed to the desired type, return the
    -- converted value, otherwise throw a 'KeyError'.
    require :: Configured a => Config -> Name -> IO a
    require cfg name = do
      val <- lookup cfg name
      case val of
        Just v -> return v
        _      -> throwIO . KeyError $ name
    
    -- | Look up a name in the given 'Config'.  If a binding exists, and
    -- the value can be converted to the desired type, return it,
    -- otherwise return the default value.
    lookupDefault :: Configured a =>
                     a
                  -- ^ Default value to return if 'lookup' or 'convert'
                  -- fails.
                  -> Config -> Name -> IO a
    lookupDefault def cfg name = fromMaybe def <$> lookup cfg name
    

    Found in Data.Configurator from the package configurator
        -- $group
    
        -- ** Importing files
        -- $import
    
        -- * Types
          Worth(..)
        -- * Loading configuration data
        , autoReload
        , autoReloadGroups
        , autoConfig
        , empty
        -- * Lookup functions
        , lookup
        , lookupDefault
        , require
        -- * Notification of configuration changes
        -- $notify
        , prefix
        , exact
    

    map See 9 Occurences [+] Collapse [-]
    Found in Ersatz.Codec from the package ersatz
    instance (Codec a, Codec b, Codec c, Codec d, Codec e, Codec f, Codec g) => Codec (a,b,c,d,e,f,g) where
      type Decoded (a,b,c,d,e,f,g) = (Decoded a, Decoded b, Decoded c, Decoded d, Decoded e, Decoded f, Decoded g)
      decode s (a,b,c,d,e,f,g) = (,,,,,,) <$> decode s a <*> decode s b <*> decode s c <*> decode s d <*> decode s e <*> decode s f <*> decode s g
      encode   (a,b,c,d,e,f,g) = (encode a, encode b, encode c, encode d, encode e, encode f, encode g)
    
    instance (Codec a, Codec b, Codec c, Codec d, Codec e, Codec f, Codec g, Codec h) => Codec (a,b,c,d,e,f,g,h) where
      type Decoded (a,b,c,d,e,f,g,h) = (Decoded a, Decoded b, Decoded c, Decoded d, Decoded e, Decoded f, Decoded g, Decoded h)
      decode s (a,b,c,d,e,f,g,h) = (,,,,,,,) <$> decode s a <*> decode s b <*> decode s c <*> decode s d <*> decode s e <*> decode s f <*> decode s g <*> decode s h
      encode   (a,b,c,d,e,f,g,h) = (encode a, encode b, encode c, encode d, encode e, encode f, encode g, encode h)
    
    instance Codec a => Codec [a] where
      type Decoded [a] = [Decoded a]
      decode = mapM . decode
      encode = map encode
    
    instance (Ix i, Codec e) => Codec (Array i e) where
      type Decoded (Array i e) = Array i (Decoded e)
      decode = mapM . decode
      encode = fmap encode
    

    Found in Ersatz.Problem from the package ersatz
                        , intDec (Seq.length tClauses)
                        , int64Dec (wdimacsTopWeight t)
                        ]
        clauses = foldMap (uncurry bWClause) tClauses
    
        tClauses = wdimacsClauses t
    
    bComment :: ByteString -> Builder
    bComment bs = bLine [ char7 'c', byteString bs ]
    
    bClause :: IntSet -> Builder
    bClause = IntSet.foldl' ( \ e i -> intDec i <> char7 ' ' <> e ) ( char7 '0' <> char7 '\n' )
    
    bWClause :: Int64 -> IntSet -> Builder
    bWClause w ls = bLine0 (int64Dec w : map intDec (IntSet.toList ls))
    
    bLine0 :: [Builder] -> Builder
    bLine0 = bLine . (++ [char7 '0'])
    
    bLine :: [Builder] -> Builder
    

    Found in Ersatz.Problem from the package ersatz
        clauses = foldMap bClause tClauses
    
        tClauses = dimacsClauses t
    
    -- | Generate a 'Builder' out of a 'QDIMACS' problem.
    qdimacs :: QDIMACS t => t -> Builder
    qdimacs t = comments <> problem <> quantified <> clauses
      where
        comments = foldMap bComment (qdimacsComments t)
        problem = bLine [ string7 "p cnf"
                        , intDec (qdimacsNumVariables t)
                        , intDec (Seq.length tClauses)
                        ]
        quantified = foldMap go tQuantGroups
          where go ls = bLine0 (q (head ls) : map (intDec . getQuant) ls)
                q Exists{} = char7 'e'
                q Forall{} = char7 'a'
        clauses = foldMap bClause tClauses
    
        tQuantGroups = List.groupBy eqQuant (qdimacsQuantified t)
    

    Found in Data.HashSet from the package unordered-containers
    insert :: (Eq a, Hashable a) => a -> HashSet a -> HashSet a
    insert a = HashSet . H.insert a () . asMap
    {-# INLINABLE insert #-}
    
    -- | /O(log n)/ Remove the specified value from this set if
    -- present.
    delete :: (Eq a, Hashable a) => a -> HashSet a -> HashSet a
    delete a = HashSet . H.delete a . asMap
    {-# INLINABLE delete #-}
    
    -- | /O(n)/ Transform this set by applying a function to every value.
    -- The resulting set may be smaller than the source.
    map :: (Hashable b, Eq b) => (a -> b) -> HashSet a -> HashSet b
    map f = fromList . List.map f . toList
    {-# INLINE map #-}
    
    -- | /O(n)/ Difference of two sets. Return elements of the first set
    -- not existing in the second.
    difference :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
    difference (HashSet a) (HashSet b) = HashSet (H.difference a b)
    

    Found in Data.HashSet from the package unordered-containers
    -- | /O(log n)/ Add the specified value to this set.
    insert :: (Eq a, Hashable a) => a -> HashSet a -> HashSet a
    insert a = HashSet . H.insert a () . asMap
    {-# INLINABLE insert #-}
    
    -- | /O(log n)/ Remove the specified value from this set if
    -- present.
    delete :: (Eq a, Hashable a) => a -> HashSet a -> HashSet a
    delete a = HashSet . H.delete a . asMap
    {-# INLINABLE delete #-}
    
    -- | /O(n)/ Transform this set by applying a function to every value.
    -- The resulting set may be smaller than the source.
    map :: (Hashable b, Eq b) => (a -> b) -> HashSet a -> HashSet b
    map f = fromList . List.map f . toList
    {-# INLINE map #-}
    
    -- | /O(n)/ Difference of two sets. Return elements of the first set
    -- not existing in the second.
    difference :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
    

    Found in Data.HashSet from the package unordered-containers
    -- | /O(log n)/ Add the specified value to this set.
    insert :: (Eq a, Hashable a) => a -> HashSet a -> HashSet a
    insert a = HashSet . H.insert a () . asMap
    {-# INLINABLE insert #-}
    
    -- | /O(log n)/ Remove the specified value from this set if
    -- present.
    delete :: (Eq a, Hashable a) => a -> HashSet a -> HashSet a
    delete a = HashSet . H.delete a . asMap
    {-# INLINABLE delete #-}
    
    -- | /O(n)/ Transform this set by applying a function to every value.
    -- The resulting set may be smaller than the source.
    map :: (Hashable b, Eq b) => (a -> b) -> HashSet a -> HashSet b
    map f = fromList . List.map f . toList
    {-# INLINE map #-}
    
    -- | /O(n)/ Difference of two sets. Return elements of the first set
    -- not existing in the second.
    difference :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
    

    Found in Data.HashSet from the package unordered-containers
    -- | /O(log n)/ Add the specified value to this set.
    insert :: (Eq a, Hashable a) => a -> HashSet a -> HashSet a
    insert a = HashSet . H.insert a () . asMap
    {-# INLINABLE insert #-}
    
    -- | /O(log n)/ Remove the specified value from this set if
    -- present.
    delete :: (Eq a, Hashable a) => a -> HashSet a -> HashSet a
    delete a = HashSet . H.delete a . asMap
    {-# INLINABLE delete #-}
    
    -- | /O(n)/ Transform this set by applying a function to every value.
    -- The resulting set may be smaller than the source.
    map :: (Hashable b, Eq b) => (a -> b) -> HashSet a -> HashSet b
    map f = fromList . List.map f . toList
    {-# INLINE map #-}
    
    -- | /O(n)/ Difference of two sets. Return elements of the first set
    -- not existing in the second.
    

    Found in Data.HashSet from the package unordered-containers
        , toMap
        , fromMap
        ) where
    
    import Control.DeepSeq (NFData(..))
    import Data.Data hiding (Typeable)
    import Data.HashMap.Base (HashMap, foldrWithKey, equalKeys)
    import Data.Hashable (Hashable(hashWithSalt))
    #if __GLASGOW_HASKELL__ >= 711
    import Data.Semigroup (Semigroup(..))
    #elif __GLASGOW_HASKELL__ < 709
    import Data.Monoid (Monoid(..))
    #endif
    import GHC.Exts (build)
    import Prelude hiding (filter, foldr, map, null)
    import qualified Data.Foldable as Foldable
    import qualified Data.HashMap.Lazy as H
    import qualified Data.List as List
    import Data.Typeable (Typeable)
    import Text.Read
    

    Found in Data.HashSet from the package unordered-containers
        , singleton
    
        -- * Combine
        , union
        , unions
    
        -- * Basic interface
        , null
        , size
        , member
        , insert
        , delete
    
        -- * Transformations
        , map
    
          -- * Difference and intersection
        , difference
        , intersection
    

    mapMaybe See 2 Occurences [+] Collapse [-]
    Found in SourceMap from the package sourcemap
    import           Data.Text (Text)
    import           Data.Text.Lazy.Encoding (decodeUtf8)
    
    -- | Generate the JSON from a source mapping.
    generate :: SourceMapping -> Value
    generate SourceMapping{..} = Object (Map.fromList obj) where
      obj = [("version",toJSON version)
            ,("file",toJSON smFile)
            ,("sources",toJSON sources)
            ,("names",toJSON names)
            ,("mappings",toJSON (decodeUtf8 (encodeMappings sources names smMappings)))] ++
            [("sourceRoot",toJSON root) | Just root <- [smSourceRoot]]
      names = nub $ mapMaybe mapName smMappings
      sources = symbols mapSourceFile
      symbols f = sort (nub (mapMaybe f smMappings))
    
    -- | Encode the mappings to the source map format.
    encodeMappings :: [FilePath] -> [Text] -> [Mapping] -> ByteString
    encodeMappings sources names = go . sortBy (comparing mapGenerated) where
      go mappings = runST $ do
    

    Found in SourceMap from the package sourcemap
    import           Data.Ord
    import           Data.STRef
    import           Data.Text (Text)
    import           Data.Text.Lazy.Encoding (decodeUtf8)
    
    -- | Generate the JSON from a source mapping.
    generate :: SourceMapping -> Value
    generate SourceMapping{..} = Object (Map.fromList obj) where
      obj = [("version",toJSON version)
            ,("file",toJSON smFile)
            ,("sources",toJSON sources)
            ,("names",toJSON names)
            ,("mappings",toJSON (decodeUtf8 (encodeMappings sources names smMappings)))] ++
            [("sourceRoot",toJSON root) | Just root <- [smSourceRoot]]
      names = nub $ mapMaybe mapName smMappings
      sources = symbols mapSourceFile
      symbols f = sort (nub (mapMaybe f smMappings))
    
    -- | Encode the mappings to the source map format.
    encodeMappings :: [FilePath] -> [Text] -> [Mapping] -> ByteString
    

    mapMaybeWithKey No usage example found for this symbol :( Collapse [-]
    mapWithKey No usage example found for this symbol :( Collapse [-]
    member See 4 Occurences [+] Collapse [-]
    Found in Data.HashSet from the package unordered-containers
    null = H.null . asMap
    {-# INLINE null #-}
    
    -- | /O(n)/ Return the number of elements in this set.
    size :: HashSet a -> Int
    size = H.size . asMap
    {-# INLINE size #-}
    
    -- | /O(log n)/ Return 'True' if the given value is present in this
    -- set, 'False' otherwise.
    member :: (Eq a, Hashable a) => a -> HashSet a -> Bool
    member a s = case H.lookup a (asMap s) of
                   Just _ -> True
                   _      -> False
    {-# INLINABLE member #-}
    
    -- | /O(log n)/ Add the specified value to this set.
    insert :: (Eq a, Hashable a) => a -> HashSet a -> HashSet a
    insert a = HashSet . H.insert a () . asMap
    {-# INLINABLE insert #-}
    

    Found in Data.HashSet from the package unordered-containers
    -- | /O(1)/ Return 'True' if this set is empty, 'False' otherwise.
    null :: HashSet a -> Bool
    null = H.null . asMap
    {-# INLINE null #-}
    
    -- | /O(n)/ Return the number of elements in this set.
    size :: HashSet a -> Int
    size = H.size . asMap
    {-# INLINE size #-}
    
    -- | /O(log n)/ Return 'True' if the given value is present in this
    -- set, 'False' otherwise.
    member :: (Eq a, Hashable a) => a -> HashSet a -> Bool
    member a s = case H.lookup a (asMap s) of
                   Just _ -> True
                   _      -> False
    {-# INLINABLE member #-}
    
    -- | /O(log n)/ Add the specified value to this set.
    

    Found in Data.HashSet from the package unordered-containers
    {-# INLINE unions #-}
    
    -- | /O(1)/ Return 'True' if this set is empty, 'False' otherwise.
    null :: HashSet a -> Bool
    null = H.null . asMap
    {-# INLINE null #-}
    
    -- | /O(n)/ Return the number of elements in this set.
    size :: HashSet a -> Int
    size = H.size . asMap
    {-# INLINE size #-}
    
    -- | /O(log n)/ Return 'True' if the given value is present in this
    -- set, 'False' otherwise.
    member :: (Eq a, Hashable a) => a -> HashSet a -> Bool
    member a s = case H.lookup a (asMap s) of
                   Just _ -> True
                   _      -> False
    {-# INLINABLE member #-}
    

    Found in Data.HashSet from the package unordered-containers
        (
          HashSet
    
        -- * Construction
        , empty
        , singleton
    
        -- * Combine
        , union
        , unions
    
        -- * Basic interface
        , null
        , size
        , member
        , insert
        , delete
    
        -- * Transformations
        , map
    

    null See 7 Occurences [+] Collapse [-]
    Found in Ersatz.Problem from the package ersatz
    instance QDIMACS QSAT where
      qdimacsComments _ = []
      qdimacsNumVariables q = q^.lastAtom + padding
        where
          -- "The innermost quantified set is always of type 'e'" per QDIMACS
          -- standard. Add an existential atom if the last one is universal.
          padding
            | Just (i, _) <- IntSet.maxView (q^.universals), i == q^.lastAtom = 1
            | otherwise = 0
      -- "Unbound atoms are to be considered as being existentially quantified in
      -- the first (i.e., the outermost) quantified set." per QDIMACS standard.
      -- Skip the implicit first existentials.
      qdimacsQuantified q
        | IntSet.null (q^.universals) = []
        | otherwise = quants [head qUniversals..lastAtom'] qUniversals
        where
          lastAtom'   = qdimacsNumVariables q
          qUniversals = IntSet.toAscList (q^.universals)
    

    Found in Data.HashSet from the package unordered-containers
    union :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
    union s1 s2 = HashSet $ H.union (asMap s1) (asMap s2)
    {-# INLINE union #-}
    
    -- TODO: Figure out the time complexity of 'unions'.
    
    -- | Construct a set containing all elements from a list of sets.
    unions :: (Eq a, Hashable a) => [HashSet a] -> HashSet a
    unions = List.foldl' union empty
    {-# INLINE unions #-}
    
    -- | /O(1)/ Return 'True' if this set is empty, 'False' otherwise.
    null :: HashSet a -> Bool
    null = H.null . asMap
    {-# INLINE null #-}
    
    -- | /O(n)/ Return the number of elements in this set.
    size :: HashSet a -> Int
    size = H.size . asMap
    {-# INLINE size #-}
    

    Found in Data.HashSet from the package unordered-containers
    -- the first argument.
    union :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
    union s1 s2 = HashSet $ H.union (asMap s1) (asMap s2)
    {-# INLINE union #-}
    
    -- TODO: Figure out the time complexity of 'unions'.
    
    -- | Construct a set containing all elements from a list of sets.
    unions :: (Eq a, Hashable a) => [HashSet a] -> HashSet a
    unions = List.foldl' union empty
    {-# INLINE unions #-}
    
    -- | /O(1)/ Return 'True' if this set is empty, 'False' otherwise.
    null :: HashSet a -> Bool
    null = H.null . asMap
    {-# INLINE null #-}
    
    -- | /O(n)/ Return the number of elements in this set.
    size :: HashSet a -> Int
    size = H.size . asMap
    

    Found in Data.HashSet from the package unordered-containers
    -- the first argument.
    union :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
    union s1 s2 = HashSet $ H.union (asMap s1) (asMap s2)
    {-# INLINE union #-}
    
    -- TODO: Figure out the time complexity of 'unions'.
    
    -- | Construct a set containing all elements from a list of sets.
    unions :: (Eq a, Hashable a) => [HashSet a] -> HashSet a
    unions = List.foldl' union empty
    {-# INLINE unions #-}
    
    -- | /O(1)/ Return 'True' if this set is empty, 'False' otherwise.
    null :: HashSet a -> Bool
    null = H.null . asMap
    {-# INLINE null #-}
    
    -- | /O(n)/ Return the number of elements in this set.
    size :: HashSet a -> Int
    size = H.size . asMap
    

    Found in Data.HashSet from the package unordered-containers
    -- To obtain good performance, the smaller set must be presented as
    -- the first argument.
    union :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
    union s1 s2 = HashSet $ H.union (asMap s1) (asMap s2)
    {-# INLINE union #-}
    
    -- TODO: Figure out the time complexity of 'unions'.
    
    -- | Construct a set containing all elements from a list of sets.
    unions :: (Eq a, Hashable a) => [HashSet a] -> HashSet a
    unions = List.foldl' union empty
    {-# INLINE unions #-}
    
    -- | /O(1)/ Return 'True' if this set is empty, 'False' otherwise.
    null :: HashSet a -> Bool
    null = H.null . asMap
    {-# INLINE null #-}
    
    -- | /O(n)/ Return the number of elements in this set.
    size :: HashSet a -> Int
    

    Found in Data.HashSet from the package unordered-containers
        , toMap
        , fromMap
        ) where
    
    import Control.DeepSeq (NFData(..))
    import Data.Data hiding (Typeable)
    import Data.HashMap.Base (HashMap, foldrWithKey, equalKeys)
    import Data.Hashable (Hashable(hashWithSalt))
    #if __GLASGOW_HASKELL__ >= 711
    import Data.Semigroup (Semigroup(..))
    #elif __GLASGOW_HASKELL__ < 709
    import Data.Monoid (Monoid(..))
    #endif
    import GHC.Exts (build)
    import Prelude hiding (filter, foldr, map, null)
    import qualified Data.Foldable as Foldable
    import qualified Data.HashMap.Lazy as H
    import qualified Data.List as List
    import Data.Typeable (Typeable)
    import Text.Read
    

    Found in Data.HashSet from the package unordered-containers
    module Data.HashSet
        (
          HashSet
    
        -- * Construction
        , empty
        , singleton
    
        -- * Combine
        , union
        , unions
    
        -- * Basic interface
        , null
        , size
        , member
        , insert
        , delete
    

    singleton See 8 Occurences [+] Collapse [-]
    Found in Toml.Parser from the package tomland
        quotesP = string "\"\"\""
    
        allowedCharP :: Parser Text
        allowedCharP = lineEndingBackslashP <|> escapeSequenceP <|> nonControlCharP <|> eol
    
        lineEndingBackslashP :: Parser Text
        lineEndingBackslashP = Text.empty <$ try (char '\\' >> eol >> space)
    
    multilineLiteralStringP :: Parser Text
    multilineLiteralStringP = multilineP quotesP allowedCharP
      where
        quotesP = string "'''"
    
        allowedCharP :: Parser Text
        allowedCharP = nonControlCharP <|> eol <|> Text.singleton <$> tab
    
    -- Keys
    
    bareKeyP :: Parser Text
    bareKeyP = lexeme $ Text.pack <$> bareStrP
    

    Found in Toml.Parser from the package tomland
                        'b'  -> pure "\b"
                        't'  -> pure "\t"
                        'n'  -> pure "\n"
                        'f'  -> pure "\f"
                        'r'  -> pure "\r"
                        '"'  -> pure "\""
                        '\\' -> pure "\\"
                        'u'  -> hexUnicodeP 4
                        'U'  -> hexUnicodeP 8
                        c    -> fail $ "Invalid escape sequence: " <> "\\" <> [c]
      where
        hexUnicodeP :: Int -> Parser Text
        hexUnicodeP n = count n hexDigitChar
                        >>= \x -> case toUnicode $ hexToInt x of
                              Just c  -> pure (Text.singleton c)
                              Nothing -> fail $ "Invalid unicode character: " <> "\\" <> (if n == 4 then "u" else "U") <> x
          where
            hexToInt :: String -> Int
            hexToInt xs = read $ "0x" ++ xs
    

    Found in Toml.Parser from the package tomland
    text_ :: Text -> Parser ()
    text_ = void . text
    
    ----------------------------------------------------------------------------
    -- TOML parser
    ----------------------------------------------------------------------------
    
    -- Strings
    
    textP :: Parser Text
    textP = multilineBasicStringP <|> multilineLiteralStringP <|> literalStringP <|> basicStringP
    
    nonControlCharP :: Parser Text
    nonControlCharP = Text.singleton <$> satisfy (not . isControl)
    
    escapeSequenceP :: Parser Text
    escapeSequenceP = char '\\' >> anyChar >>= \case
                        'b'  -> pure "\b"
                        't'  -> pure "\t"
    

    Found in Data.HashSet from the package unordered-containers
    fromListConstr :: Constr
    fromListConstr = mkConstr hashSetDataType "fromList" [] Prefix
    
    hashSetDataType :: DataType
    hashSetDataType = mkDataType "Data.HashSet" [fromListConstr]
    
    -- | /O(1)/ Construct an empty set.
    empty :: HashSet a
    empty = HashSet H.empty
    
    -- | /O(1)/ Construct a set with a single element.
    singleton :: Hashable a => a -> HashSet a
    singleton a = HashSet (H.singleton a ())
    {-# INLINABLE singleton #-}
    
    -- | /O(1)/ Convert to the equivalent 'HashMap'.
    toMap :: HashSet a -> HashMap a ()
    toMap = asMap
    

    Found in Data.HashSet from the package unordered-containers
        hashWithSalt salt = hashWithSalt salt . asMap
    
    fromListConstr :: Constr
    fromListConstr = mkConstr hashSetDataType "fromList" [] Prefix
    
    hashSetDataType :: DataType
    hashSetDataType = mkDataType "Data.HashSet" [fromListConstr]
    
    -- | /O(1)/ Construct an empty set.
    empty :: HashSet a
    empty = HashSet H.empty
    
    -- | /O(1)/ Construct a set with a single element.
    singleton :: Hashable a => a -> HashSet a
    singleton a = HashSet (H.singleton a ())
    {-# INLINABLE singleton #-}
    
    -- | /O(1)/ Convert to the equivalent 'HashMap'.
    toMap :: HashSet a -> HashMap a ()
    toMap = asMap
    

    Found in Data.HashSet from the package unordered-containers
        hashWithSalt salt = hashWithSalt salt . asMap
    
    fromListConstr :: Constr
    fromListConstr = mkConstr hashSetDataType "fromList" [] Prefix
    
    hashSetDataType :: DataType
    hashSetDataType = mkDataType "Data.HashSet" [fromListConstr]
    
    -- | /O(1)/ Construct an empty set.
    empty :: HashSet a
    empty = HashSet H.empty
    
    -- | /O(1)/ Construct a set with a single element.
    singleton :: Hashable a => a -> HashSet a
    singleton a = HashSet (H.singleton a ())
    {-# INLINABLE singleton #-}
    
    -- | /O(1)/ Convert to the equivalent 'HashMap'.
    toMap :: HashSet a -> HashMap a ()
    toMap = asMap
    

    Found in Data.HashSet from the package unordered-containers
    instance (Hashable a) => Hashable (HashSet a) where
        hashWithSalt salt = hashWithSalt salt . asMap
    
    fromListConstr :: Constr
    fromListConstr = mkConstr hashSetDataType "fromList" [] Prefix
    
    hashSetDataType :: DataType
    hashSetDataType = mkDataType "Data.HashSet" [fromListConstr]
    
    -- | /O(1)/ Construct an empty set.
    empty :: HashSet a
    empty = HashSet H.empty
    
    -- | /O(1)/ Construct a set with a single element.
    singleton :: Hashable a => a -> HashSet a
    singleton a = HashSet (H.singleton a ())
    {-# INLINABLE singleton #-}
    
    -- | /O(1)/ Convert to the equivalent 'HashMap'.
    toMap :: HashSet a -> HashMap a ()
    

    Found in Data.HashSet from the package unordered-containers
    -- 'HashSet' is often faster than other tree-based set types,
    -- especially when value comparison is expensive, as in the case of
    -- strings.
    --
    -- Many operations have a average-case complexity of /O(log n)/.  The
    -- implementation uses a large base (i.e. 16) so in practice these
    -- operations are constant time.
    
    module Data.HashSet
        (
          HashSet
    
        -- * Construction
        , empty
        , singleton
    
        -- * Combine
        , union
        , unions
    

    size See 5 Occurences [+] Collapse [-]
    Found in Data.HashSet from the package unordered-containers
    -- | Construct a set containing all elements from a list of sets.
    unions :: (Eq a, Hashable a) => [HashSet a] -> HashSet a
    unions = List.foldl' union empty
    {-# INLINE unions #-}
    
    -- | /O(1)/ Return 'True' if this set is empty, 'False' otherwise.
    null :: HashSet a -> Bool
    null = H.null . asMap
    {-# INLINE null #-}
    
    -- | /O(n)/ Return the number of elements in this set.
    size :: HashSet a -> Int
    size = H.size . asMap
    {-# INLINE size #-}
    
    -- | /O(log n)/ Return 'True' if the given value is present in this
    -- set, 'False' otherwise.
    member :: (Eq a, Hashable a) => a -> HashSet a -> Bool
    member a s = case H.lookup a (asMap s) of
    

    Found in Data.HashSet from the package unordered-containers
    -- TODO: Figure out the time complexity of 'unions'.
    
    -- | Construct a set containing all elements from a list of sets.
    unions :: (Eq a, Hashable a) => [HashSet a] -> HashSet a
    unions = List.foldl' union empty
    {-# INLINE unions #-}
    
    -- | /O(1)/ Return 'True' if this set is empty, 'False' otherwise.
    null :: HashSet a -> Bool
    null = H.null . asMap
    {-# INLINE null #-}
    
    -- | /O(n)/ Return the number of elements in this set.
    size :: HashSet a -> Int
    size = H.size . asMap
    {-# INLINE size #-}
    
    -- | /O(log n)/ Return 'True' if the given value is present in this
    -- set, 'False' otherwise.
    member :: (Eq a, Hashable a) => a -> HashSet a -> Bool
    

    Found in Data.HashSet from the package unordered-containers
    -- TODO: Figure out the time complexity of 'unions'.
    
    -- | Construct a set containing all elements from a list of sets.
    unions :: (Eq a, Hashable a) => [HashSet a] -> HashSet a
    unions = List.foldl' union empty
    {-# INLINE unions #-}
    
    -- | /O(1)/ Return 'True' if this set is empty, 'False' otherwise.
    null :: HashSet a -> Bool
    null = H.null . asMap
    {-# INLINE null #-}
    
    -- | /O(n)/ Return the number of elements in this set.
    size :: HashSet a -> Int
    size = H.size . asMap
    {-# INLINE size #-}
    
    -- | /O(log n)/ Return 'True' if the given value is present in this
    -- set, 'False' otherwise.
    member :: (Eq a, Hashable a) => a -> HashSet a -> Bool
    

    Found in Data.HashSet from the package unordered-containers
    -- TODO: Figure out the time complexity of 'unions'.
    
    -- | Construct a set containing all elements from a list of sets.
    unions :: (Eq a, Hashable a) => [HashSet a] -> HashSet a
    unions = List.foldl' union empty
    {-# INLINE unions #-}
    
    -- | /O(1)/ Return 'True' if this set is empty, 'False' otherwise.
    null :: HashSet a -> Bool
    null = H.null . asMap
    {-# INLINE null #-}
    
    -- | /O(n)/ Return the number of elements in this set.
    size :: HashSet a -> Int
    size = H.size . asMap
    {-# INLINE size #-}
    
    -- | /O(log n)/ Return 'True' if the given value is present in this
    -- set, 'False' otherwise.
    

    Found in Data.HashSet from the package unordered-containers
    module Data.HashSet
        (
          HashSet
    
        -- * Construction
        , empty
        , singleton
    
        -- * Combine
        , union
        , unions
    
        -- * Basic interface
        , null
        , size
        , member
        , insert
        , delete
    
        -- * Transformations
    

    toList See 14 Occurences [+] Collapse [-]
    Found in Ersatz.Problem from the package ersatz
                        , intDec (Seq.length tClauses)
                        , int64Dec (wdimacsTopWeight t)
                        ]
        clauses = foldMap (uncurry bWClause) tClauses
    
        tClauses = wdimacsClauses t
    
    bComment :: ByteString -> Builder
    bComment bs = bLine [ char7 'c', byteString bs ]
    
    bClause :: IntSet -> Builder
    bClause = IntSet.foldl' ( \ e i -> intDec i <> char7 ' ' <> e ) ( char7 '0' <> char7 '\n' )
    
    bWClause :: Int64 -> IntSet -> Builder
    bWClause w ls = bLine0 (int64Dec w : map intDec (IntSet.toList ls))
    
    bLine0 :: [Builder] -> Builder
    bLine0 = bLine . (++ [char7 '0'])
    
    bLine :: [Builder] -> Builder
    

    Found in Data.Greskell.Greskell from the package greskell-core
    -- "[:]"
    --
    -- Note that 'Aeson.Number' does not distinguish integers from
    -- floating-point numbers, so 'value' function may format an integer
    -- as a floating-point number. To ensure formatting as integers, use
    -- 'valueInt'.
    value :: Value -> Greskell Value
    value Aeson.Null = unsafeGreskellLazy "null"
    value (Aeson.Bool b) = unsafeToValue (if b then true else false)
    value (Aeson.Number sci) = unsafeToValue $ number sci
    value (Aeson.String s) = unsafeToValue $ string s
    value (Aeson.Array v) = unsafeToValue $ list $ map value $ toList v
    value (Aeson.Object obj)
      | HM.null obj = unsafeGreskellLazy "[:]"
      | otherwise = unsafeGreskellLazy $ toGroovyMap $ HM.toList obj
      where
        toGroovyMap pairs = "[" <> TL.intercalate "," (map toPairText pairs) <> "]"
        toPairText (key, val) = (toGremlinLazy $ string key) <> ":" <> (toGremlinLazy $ value val)
    
    -- | Integer literal as 'Value' type.
    

    Found in Data.Greskell.Greskell from the package greskell-core
    -- >>> toGremlin $ value $ Aeson.toJSON $ ([10, 20, 30] :: [Int])
    -- "[10.0,20.0,30.0]"
    -- >>> toGremlin $ value $ Aeson.Object mempty
    -- "[:]"
    --
    -- Note that 'Aeson.Number' does not distinguish integers from
    -- floating-point numbers, so 'value' function may format an integer
    -- as a floating-point number. To ensure formatting as integers, use
    -- 'valueInt'.
    value :: Value -> Greskell Value
    value Aeson.Null = unsafeGreskellLazy "null"
    value (Aeson.Bool b) = unsafeToValue (if b then true else false)
    value (Aeson.Number sci) = unsafeToValue $ number sci
    value (Aeson.String s) = unsafeToValue $ string s
    value (Aeson.Array v) = unsafeToValue $ list $ map value $ toList v
    value (Aeson.Object obj)
      | HM.null obj = unsafeGreskellLazy "[:]"
      | otherwise = unsafeGreskellLazy $ toGroovyMap $ HM.toList obj
      where
        toGroovyMap pairs = "[" <> TL.intercalate "," (map toPairText pairs) <> "]"
    

    Found in Data.Greskell.Greskell from the package greskell-core
             value,
             valueInt,
             gvalue,
             gvalueInt,
             -- * Unsafe constructors
             unsafeGreskell,
             unsafeGreskellLazy,
             unsafeFunCall,
             unsafeMethodCall
           ) where
    
    import Data.Aeson (Value)
    import qualified Data.Aeson as Aeson
    import Data.Bifunctor (bimap)
    import Data.Foldable (toList)
    import qualified Data.HashMap.Lazy as HM
    import Data.Monoid (Monoid(..))
    import Data.Ratio (numerator, denominator, Rational)
    import Data.Scientific (Scientific, coefficient, base10Exponent)
    import Data.Semigroup (Semigroup(..))
    

    Found in Data.HashSet from the package unordered-containers
    -- produced lazily.
    toList :: HashSet a -> [a]
    toList t = build (\ c z -> foldrWithKey ((const .) c) z (asMap t))
    {-# INLINE toList #-}
    
    -- | /O(n*min(W, n))/ Construct a set from a list of elements.
    fromList :: (Eq a, Hashable a) => [a] -> HashSet a
    fromList = HashSet . List.foldl' (\ m k -> H.insert k () m) H.empty
    {-# INLINE fromList #-}
    
    #if __GLASGOW_HASKELL__ >= 708
    instance (Eq a, Hashable a) => Exts.IsList (HashSet a) where
        type Item (HashSet a) = a
        fromList = fromList
        toList   = toList
    #endif
    

    Found in Data.HashSet from the package unordered-containers
    -- produced lazily.
    toList :: HashSet a -> [a]
    toList t = build (\ c z -> foldrWithKey ((const .) c) z (asMap t))
    {-# INLINE toList #-}
    
    -- | /O(n*min(W, n))/ Construct a set from a list of elements.
    fromList :: (Eq a, Hashable a) => [a] -> HashSet a
    fromList = HashSet . List.foldl' (\ m k -> H.insert k () m) H.empty
    {-# INLINE fromList #-}
    
    #if __GLASGOW_HASKELL__ >= 708
    instance (Eq a, Hashable a) => Exts.IsList (HashSet a) where
        type Item (HashSet a) = a
        fromList = fromList
        toList   = toList
    #endif
    

    Found in Data.HashSet from the package unordered-containers
      where g k _ z = f k z
    {-# INLINE foldr #-}
    
    -- | /O(n)/ Filter this set by retaining only elements satisfying a
    -- predicate.
    filter :: (a -> Bool) -> HashSet a -> HashSet a
    filter p = HashSet . H.filterWithKey q . asMap
      where q k _ = p k
    {-# INLINE filter #-}
    
    -- | /O(n)/ Return a list of this set's elements.  The list is
    -- produced lazily.
    toList :: HashSet a -> [a]
    toList t = build (\ c z -> foldrWithKey ((const .) c) z (asMap t))
    {-# INLINE toList #-}
    
    -- | /O(n*min(W, n))/ Construct a set from a list of elements.
    fromList :: (Eq a, Hashable a) => [a] -> HashSet a
    fromList = HashSet . List.foldl' (\ m k -> H.insert k () m) H.empty
    {-# INLINE fromList #-}
    

    Found in Data.HashSet from the package unordered-containers
    foldr f z0 = foldrWithKey g z0 . asMap
      where g k _ z = f k z
    {-# INLINE foldr #-}
    
    -- | /O(n)/ Filter this set by retaining only elements satisfying a
    -- predicate.
    filter :: (a -> Bool) -> HashSet a -> HashSet a
    filter p = HashSet . H.filterWithKey q . asMap
      where q k _ = p k
    {-# INLINE filter #-}
    
    -- | /O(n)/ Return a list of this set's elements.  The list is
    -- produced lazily.
    toList :: HashSet a -> [a]
    toList t = build (\ c z -> foldrWithKey ((const .) c) z (asMap t))
    {-# INLINE toList #-}
    
    -- | /O(n*min(W, n))/ Construct a set from a list of elements.
    fromList :: (Eq a, Hashable a) => [a] -> HashSet a
    fromList = HashSet . List.foldl' (\ m k -> H.insert k () m) H.empty
    

    Found in Data.HashSet from the package unordered-containers
    foldr :: (b -> a -> a) -> a -> HashSet b -> a
    foldr f z0 = foldrWithKey g z0 . asMap
      where g k _ z = f k z
    {-# INLINE foldr #-}
    
    -- | /O(n)/ Filter this set by retaining only elements satisfying a
    -- predicate.
    filter :: (a -> Bool) -> HashSet a -> HashSet a
    filter p = HashSet . H.filterWithKey q . asMap
      where q k _ = p k
    {-# INLINE filter #-}
    
    -- | /O(n)/ Return a list of this set's elements.  The list is
    -- produced lazily.
    toList :: HashSet a -> [a]
    toList t = build (\ c z -> foldrWithKey ((const .) c) z (asMap t))
    {-# INLINE toList #-}
    
    -- | /O(n*min(W, n))/ Construct a set from a list of elements.
    fromList :: (Eq a, Hashable a) => [a] -> HashSet a
    

    Found in Data.HashSet from the package unordered-containers
    -- | /O(log n)/ Add the specified value to this set.
    insert :: (Eq a, Hashable a) => a -> HashSet a -> HashSet a
    insert a = HashSet . H.insert a () . asMap
    {-# INLINABLE insert #-}
    
    -- | /O(log n)/ Remove the specified value from this set if
    -- present.
    delete :: (Eq a, Hashable a) => a -> HashSet a -> HashSet a
    delete a = HashSet . H.delete a . asMap
    {-# INLINABLE delete #-}
    
    -- | /O(n)/ Transform this set by applying a function to every value.
    -- The resulting set may be smaller than the source.
    map :: (Hashable b, Eq b) => (a -> b) -> HashSet a -> HashSet b
    map f = fromList . List.map f . toList
    {-# INLINE map #-}
    
    -- | /O(n)/ Difference of two sets. Return elements of the first set
    -- not existing in the second.
    difference :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
    

    Found in Data.HashSet from the package unordered-containers
        readListPrec = readListPrecDefault
    
    #if MIN_VERSION_base(4,9,0)
    instance Show1 HashSet where
        liftShowsPrec sp sl d m =
            showsUnaryWith (liftShowsPrec sp sl) "fromList" d (toList m)
    #endif
    
    instance (Show a) => Show (HashSet a) where
        showsPrec d m = showParen (d > 10) $
          showString "fromList " . shows (toList m)
    
    instance (Data a, Eq a, Hashable a) => Data (HashSet a) where
        gfoldl f z m   = z fromList `f` toList m
        toConstr _     = fromListConstr
        gunfold k z c  = case constrIndex c of
            1 -> k (z fromList)
            _ -> error "gunfold"
        dataTypeOf _   = hashSetDataType
    

    Found in Data.HashSet from the package unordered-containers
          Ident "fromList" <- lexP
          xs <- readPrec
          return (fromList xs)
    
        readListPrec = readListPrecDefault
    
    #if MIN_VERSION_base(4,9,0)
    instance Show1 HashSet where
        liftShowsPrec sp sl d m =
            showsUnaryWith (liftShowsPrec sp sl) "fromList" d (toList m)
    #endif
    
    instance (Show a) => Show (HashSet a) where
        showsPrec d m = showParen (d > 10) $
          showString "fromList " . shows (toList m)
    
    instance (Data a, Eq a, Hashable a) => Data (HashSet a) where
        gfoldl f z m   = z fromList `f` toList m
        toConstr _     = fromListConstr
        gunfold k z c  = case constrIndex c of
    

    Found in Data.HashSet from the package unordered-containers
    #endif
        {-# INLINE mappend #-}
    
    instance (Eq a, Hashable a, Read a) => Read (HashSet a) where
        readPrec = parens $ prec 10 $ do
          Ident "fromList" <- lexP
          xs <- readPrec
          return (fromList xs)
    
        readListPrec = readListPrecDefault
    
    #if MIN_VERSION_base(4,9,0)
    instance Show1 HashSet where
        liftShowsPrec sp sl d m =
            showsUnaryWith (liftShowsPrec sp sl) "fromList" d (toList m)
    #endif
    
    instance (Show a) => Show (HashSet a) where
        showsPrec d m = showParen (d > 10) $
          showString "fromList " . shows (toList m)
    

    Found in Data.HashSet from the package unordered-containers
          -- * Difference and intersection
        , difference
        , intersection
    
        -- * Folds
        , foldl'
        , foldr
    
        -- * Filter
        , filter
    
        -- * Conversions
    
        -- ** Lists
        , toList
        , fromList
    
        -- * HashMaps
        , toMap
        , fromMap
    

    traverseWithKey No usage example found for this symbol :( Collapse [-]
    union See 43 Occurences [+] Collapse [-]
    Found in Data.CharSet.Posix.Ascii from the package charset
    alnum, alpha, ascii, blank, cntrl, digit, graph, print, word, punct, space, upper, lower, xdigit :: CharSet
    alnum = alpha `union` digit
    alpha = lower `union` upper
    ascii = range '\x00' '\x7f'
    blank = fromList " \t"
    cntrl = insert '\x7f' $ range '\x00' '\x1f'
    digit = range '0' '9'
    lower = range 'a' 'z'
    upper = range 'A' 'Z'
    graph = range '\x21' '\x7e'
    print = insert '\x20' graph
    word  = insert '_' alnum
    punct = fromList "-!\"#$%&'()*+,./:;<=>?@[\\]^_`{|}~"
    space = fromList " \t\r\n\v\f"
    xdigit = digit `union` range 'a' 'f' `union` range 'A' 'F'
    
    -- :digit:, etc.
    posixAscii :: HashMap String CharSet
    posixAscii = HashMap.fromList
        [ ("alnum", alnum)
    

    Found in Data.CharSet.Posix.Ascii from the package charset
    alnum, alpha, ascii, blank, cntrl, digit, graph, print, word, punct, space, upper, lower, xdigit :: CharSet
    alnum = alpha `union` digit
    alpha = lower `union` upper
    ascii = range '\x00' '\x7f'
    blank = fromList " \t"
    cntrl = insert '\x7f' $ range '\x00' '\x1f'
    digit = range '0' '9'
    lower = range 'a' 'z'
    upper = range 'A' 'Z'
    graph = range '\x21' '\x7e'
    print = insert '\x20' graph
    word  = insert '_' alnum
    punct = fromList "-!\"#$%&'()*+,./:;<=>?@[\\]^_`{|}~"
    space = fromList " \t\r\n\v\f"
    xdigit = digit `union` range 'a' 'f' `union` range 'A' 'F'
    
    -- :digit:, etc.
    posixAscii :: HashMap String CharSet
    posixAscii = HashMap.fromList
        [ ("alnum", alnum)
    

    Found in Data.CharSet.Posix.Ascii from the package charset
        ( posixAscii
        , lookupPosixAsciiCharSet
        -- * Traditional POSIX ASCII \"classes\"
        , alnum, alpha, ascii, blank, cntrl, digit, graph, print, word, punct, space, upper, lower, xdigit
        ) where
    
    import Prelude hiding (print)
    import Data.Char
    import Data.CharSet
    import Data.HashMap.Lazy (HashMap)
    import qualified Data.HashMap.Lazy as HashMap
    
    alnum, alpha, ascii, blank, cntrl, digit, graph, print, word, punct, space, upper, lower, xdigit :: CharSet
    alnum = alpha `union` digit
    alpha = lower `union` upper
    ascii = range '\x00' '\x7f'
    blank = fromList " \t"
    cntrl = insert '\x7f' $ range '\x00' '\x1f'
    digit = range '0' '9'
    lower = range 'a' 'z'
    

    Found in Data.CharSet.Posix.Ascii from the package charset
    module Data.CharSet.Posix.Ascii
        ( posixAscii
        , lookupPosixAsciiCharSet
        -- * Traditional POSIX ASCII \"classes\"
        , alnum, alpha, ascii, blank, cntrl, digit, graph, print, word, punct, space, upper, lower, xdigit
        ) where
    
    import Prelude hiding (print)
    import Data.Char
    import Data.CharSet
    import Data.HashMap.Lazy (HashMap)
    import qualified Data.HashMap.Lazy as HashMap
    
    alnum, alpha, ascii, blank, cntrl, digit, graph, print, word, punct, space, upper, lower, xdigit :: CharSet
    alnum = alpha `union` digit
    alpha = lower `union` upper
    ascii = range '\x00' '\x7f'
    blank = fromList " \t"
    cntrl = insert '\x7f' $ range '\x00' '\x1f'
    digit = range '0' '9'
    

    Found in Data.CharSet.Posix.Unicode from the package charset
    alnum, alpha, ascii, blank, cntrl, digit, graph, print, word, punct, space, upper, lower, xdigit :: CharSet
    alnum = alpha `union` digit
    ascii = Block.basicLatin
    alpha = Category.letterAnd
    blank = insert '\t' Category.space
    cntrl = Category.control
    digit = Category.decimalNumber
    lower = Category.lowercaseLetter
    upper = Category.uppercaseLetter
    graph = complement (Category.separator `union` Category.other)
    print = complement (Category.other)
    word  = Category.letter `union` Category.number `union` Category.connectorPunctuation
    punct = Category.punctuation `union` Category.symbol
    space = fromList " \t\r\n\v\f" `union` Category.separator
    xdigit = digit `union` range 'a' 'f' `union` range 'A' 'F'
    
    -- :digit:, etc.
    posixUnicode :: HashMap String CharSet
    posixUnicode = HashMap.fromList
        [ ("alnum", alnum)
    

    Found in Data.CharSet.Posix.Unicode from the package charset
    alnum, alpha, ascii, blank, cntrl, digit, graph, print, word, punct, space, upper, lower, xdigit :: CharSet
    alnum = alpha `union` digit
    ascii = Block.basicLatin
    alpha = Category.letterAnd
    blank = insert '\t' Category.space
    cntrl = Category.control
    digit = Category.decimalNumber
    lower = Category.lowercaseLetter
    upper = Category.uppercaseLetter
    graph = complement (Category.separator `union` Category.other)
    print = complement (Category.other)
    word  = Category.letter `union` Category.number `union` Category.connectorPunctuation
    punct = Category.punctuation `union` Category.symbol
    space = fromList " \t\r\n\v\f" `union` Category.separator
    xdigit = digit `union` range 'a' 'f' `union` range 'A' 'F'
    
    -- :digit:, etc.
    posixUnicode :: HashMap String CharSet
    posixUnicode = HashMap.fromList
        [ ("alnum", alnum)
    

    Found in Data.CharSet.Posix.Unicode from the package charset
    alnum, alpha, ascii, blank, cntrl, digit, graph, print, word, punct, space, upper, lower, xdigit :: CharSet
    alnum = alpha `union` digit
    ascii = Block.basicLatin
    alpha = Category.letterAnd
    blank = insert '\t' Category.space
    cntrl = Category.control
    digit = Category.decimalNumber
    lower = Category.lowercaseLetter
    upper = Category.uppercaseLetter
    graph = complement (Category.separator `union` Category.other)
    print = complement (Category.other)
    word  = Category.letter `union` Category.number `union` Category.connectorPunctuation
    punct = Category.punctuation `union` Category.symbol
    space = fromList " \t\r\n\v\f" `union` Category.separator
    xdigit = digit `union` range 'a' 'f' `union` range 'A' 'F'
    
    -- :digit:, etc.
    posixUnicode :: HashMap String CharSet
    posixUnicode = HashMap.fromList
    

    Found in Data.CharSet.Posix.Unicode from the package charset
    import qualified Data.HashMap.Lazy as HashMap
    
    alnum, alpha, ascii, blank, cntrl, digit, graph, print, word, punct, space, upper, lower, xdigit :: CharSet
    alnum = alpha `union` digit
    ascii = Block.basicLatin
    alpha = Category.letterAnd
    blank = insert '\t' Category.space
    cntrl = Category.control
    digit = Category.decimalNumber
    lower = Category.lowercaseLetter
    upper = Category.uppercaseLetter
    graph = complement (Category.separator `union` Category.other)
    print = complement (Category.other)
    word  = Category.letter `union` Category.number `union` Category.connectorPunctuation
    punct = Category.punctuation `union` Category.symbol
    space = fromList " \t\r\n\v\f" `union` Category.separator
    xdigit = digit `union` range 'a' 'f' `union` range 'A' 'F'
    
    -- :digit:, etc.
    posixUnicode :: HashMap String CharSet
    

    Found in Data.CharSet.Posix.Unicode from the package charset
    import Data.HashMap.Lazy (HashMap)
    import qualified Data.HashMap.Lazy as HashMap
    
    alnum, alpha, ascii, blank, cntrl, digit, graph, print, word, punct, space, upper, lower, xdigit :: CharSet
    alnum = alpha `union` digit
    ascii = Block.basicLatin
    alpha = Category.letterAnd
    blank = insert '\t' Category.space
    cntrl = Category.control
    digit = Category.decimalNumber
    lower = Category.lowercaseLetter
    upper = Category.uppercaseLetter
    graph = complement (Category.separator `union` Category.other)
    print = complement (Category.other)
    word  = Category.letter `union` Category.number `union` Category.connectorPunctuation
    punct = Category.punctuation `union` Category.symbol
    space = fromList " \t\r\n\v\f" `union` Category.separator
    xdigit = digit `union` range 'a' 'f' `union` range 'A' 'F'
    
    -- :digit:, etc.
    

    Found in Data.CharSet.Posix.Unicode from the package charset
    import Data.HashMap.Lazy (HashMap)
    import qualified Data.HashMap.Lazy as HashMap
    
    alnum, alpha, ascii, blank, cntrl, digit, graph, print, word, punct, space, upper, lower, xdigit :: CharSet
    alnum = alpha `union` digit
    ascii = Block.basicLatin
    alpha = Category.letterAnd
    blank = insert '\t' Category.space
    cntrl = Category.control
    digit = Category.decimalNumber
    lower = Category.lowercaseLetter
    upper = Category.uppercaseLetter
    graph = complement (Category.separator `union` Category.other)
    print = complement (Category.other)
    word  = Category.letter `union` Category.number `union` Category.connectorPunctuation
    punct = Category.punctuation `union` Category.symbol
    space = fromList " \t\r\n\v\f" `union` Category.separator
    xdigit = digit `union` range 'a' 'f' `union` range 'A' 'F'
    
    -- :digit:, etc.
    

    Found in Data.CharSet.Posix.Unicode from the package charset
    import qualified Data.CharSet.Unicode.Category as Category
    import qualified Data.CharSet.Unicode.Block as Block
    import Data.HashMap.Lazy (HashMap)
    import qualified Data.HashMap.Lazy as HashMap
    
    alnum, alpha, ascii, blank, cntrl, digit, graph, print, word, punct, space, upper, lower, xdigit :: CharSet
    alnum = alpha `union` digit
    ascii = Block.basicLatin
    alpha = Category.letterAnd
    blank = insert '\t' Category.space
    cntrl = Category.control
    digit = Category.decimalNumber
    lower = Category.lowercaseLetter
    upper = Category.uppercaseLetter
    graph = complement (Category.separator `union` Category.other)
    print = complement (Category.other)
    word  = Category.letter `union` Category.number `union` Category.connectorPunctuation
    punct = Category.punctuation `union` Category.symbol
    space = fromList " \t\r\n\v\f" `union` Category.separator
    xdigit = digit `union` range 'a' 'f' `union` range 'A' 'F'
    

    Found in Data.CharSet.Posix.Unicode from the package charset
        , lookupPosixUnicodeCharSet
        -- * POSIX ASCII \"classes\"
        , alnum, alpha, ascii, blank, cntrl, digit, graph, print, word, punct, space, upper, lower, xdigit
        ) where
    
    import Prelude hiding (print)
    import Data.Char
    import Data.CharSet
    import qualified Data.CharSet.Unicode.Category as Category
    import qualified Data.CharSet.Unicode.Block as Block
    import Data.HashMap.Lazy (HashMap)
    import qualified Data.HashMap.Lazy as HashMap
    
    alnum, alpha, ascii, blank, cntrl, digit, graph, print, word, punct, space, upper, lower, xdigit :: CharSet
    alnum = alpha `union` digit
    ascii = Block.basicLatin
    alpha = Category.letterAnd
    blank = insert '\t' Category.space
    cntrl = Category.control
    digit = Category.decimalNumber
    

    Found in Data.CharSet.Unicode.Category from the package charset
        `union` finalQuote
        `union` connectorPunctuation
        `union` otherPunctuation
    
    control, format, privateUse, surrogate, notAssigned, other :: CharSet
    control = cat Control
    format = cat Format
    privateUse = cat PrivateUse
    surrogate = cat Surrogate
    notAssigned = cat NotAssigned
    other = control
        `union` format
        `union` privateUse
        `union` surrogate
        `union` notAssigned
    

    Found in Data.CharSet.Unicode.Category from the package charset
        `union` initialQuote
        `union` finalQuote
        `union` connectorPunctuation
        `union` otherPunctuation
    
    control, format, privateUse, surrogate, notAssigned, other :: CharSet
    control = cat Control
    format = cat Format
    privateUse = cat PrivateUse
    surrogate = cat Surrogate
    notAssigned = cat NotAssigned
    other = control
        `union` format
        `union` privateUse
        `union` surrogate
        `union` notAssigned
    

    Found in Data.CharSet.Unicode.Category from the package charset
        `union` closePunctuation
        `union` initialQuote
        `union` finalQuote
        `union` connectorPunctuation
        `union` otherPunctuation
    
    control, format, privateUse, surrogate, notAssigned, other :: CharSet
    control = cat Control
    format = cat Format
    privateUse = cat PrivateUse
    surrogate = cat Surrogate
    notAssigned = cat NotAssigned
    other = control
        `union` format
        `union` privateUse
        `union` surrogate
        `union` notAssigned
    

    Found in Data.CharSet.Unicode.Category from the package charset
        `union` openPunctuation
        `union` closePunctuation
        `union` initialQuote
        `union` finalQuote
        `union` connectorPunctuation
        `union` otherPunctuation
    
    control, format, privateUse, surrogate, notAssigned, other :: CharSet
    control = cat Control
    format = cat Format
    privateUse = cat PrivateUse
    surrogate = cat Surrogate
    notAssigned = cat NotAssigned
    other = control
        `union` format
        `union` privateUse
        `union` surrogate
        `union` notAssigned
    

    Found in Data.CharSet.Unicode.Category from the package charset
    dashPunctuation = cat DashPunctuation
    openPunctuation = cat OpenPunctuation
    closePunctuation = cat ClosePunctuation
    initialQuote = cat InitialQuote
    finalQuote = cat FinalQuote
    connectorPunctuation  = cat ConnectorPunctuation
    otherPunctuation = cat OtherPunctuation
    punctuation
              = dashPunctuation
        `union` openPunctuation
        `union` closePunctuation
        `union` initialQuote
        `union` finalQuote
        `union` connectorPunctuation
        `union` otherPunctuation
    
    control, format, privateUse, surrogate, notAssigned, other :: CharSet
    control = cat Control
    format = cat Format
    privateUse = cat PrivateUse
    

    Found in Data.CharSet.Unicode.Category from the package charset
    dashPunctuation = cat DashPunctuation
    openPunctuation = cat OpenPunctuation
    closePunctuation = cat ClosePunctuation
    initialQuote = cat InitialQuote
    finalQuote = cat FinalQuote
    connectorPunctuation  = cat ConnectorPunctuation
    otherPunctuation = cat OtherPunctuation
    punctuation
              = dashPunctuation
        `union` openPunctuation
        `union` closePunctuation
        `union` initialQuote
        `union` finalQuote
        `union` connectorPunctuation
        `union` otherPunctuation
    
    control, format, privateUse, surrogate, notAssigned, other :: CharSet
    control = cat Control
    format = cat Format
    

    Found in Data.CharSet.Unicode.Category from the package charset
      finalQuote, connectorPunctuation, otherPunctuation, punctuation :: CharSet
    
    dashPunctuation = cat DashPunctuation
    openPunctuation = cat OpenPunctuation
    closePunctuation = cat ClosePunctuation
    initialQuote = cat InitialQuote
    finalQuote = cat FinalQuote
    connectorPunctuation  = cat ConnectorPunctuation
    otherPunctuation = cat OtherPunctuation
    punctuation
              = dashPunctuation
        `union` openPunctuation
        `union` closePunctuation
        `union` initialQuote
        `union` finalQuote
        `union` connectorPunctuation
        `union` otherPunctuation
    
    control, format, privateUse, surrogate, notAssigned, other :: CharSet
    control = cat Control
    

    Found in Data.CharSet.Unicode.Category from the package charset
    dashPunctuation, openPunctuation, closePunctuation, initialQuote,
      finalQuote, connectorPunctuation, otherPunctuation, punctuation :: CharSet
    
    dashPunctuation = cat DashPunctuation
    openPunctuation = cat OpenPunctuation
    closePunctuation = cat ClosePunctuation
    initialQuote = cat InitialQuote
    finalQuote = cat FinalQuote
    connectorPunctuation  = cat ConnectorPunctuation
    otherPunctuation = cat OtherPunctuation
    punctuation
              = dashPunctuation
        `union` openPunctuation
        `union` closePunctuation
        `union` initialQuote
        `union` finalQuote
        `union` connectorPunctuation
        `union` otherPunctuation
    
    control, format, privateUse, surrogate, notAssigned, other :: CharSet
    

    Found in Data.CharSet.Unicode.Category from the package charset
    dashPunctuation, openPunctuation, closePunctuation, initialQuote,
      finalQuote, connectorPunctuation, otherPunctuation, punctuation :: CharSet
    
    dashPunctuation = cat DashPunctuation
    openPunctuation = cat OpenPunctuation
    closePunctuation = cat ClosePunctuation
    initialQuote = cat InitialQuote
    finalQuote = cat FinalQuote
    connectorPunctuation  = cat ConnectorPunctuation
    otherPunctuation = cat OtherPunctuation
    punctuation
              = dashPunctuation
        `union` openPunctuation
        `union` closePunctuation
        `union` initialQuote
        `union` finalQuote
        `union` connectorPunctuation
        `union` otherPunctuation
    

    Found in Data.CharSet.Unicode.Category from the package charset
        `union` otherNumber
    
    dashPunctuation, openPunctuation, closePunctuation, initialQuote,
      finalQuote, connectorPunctuation, otherPunctuation, punctuation :: CharSet
    
    dashPunctuation = cat DashPunctuation
    openPunctuation = cat OpenPunctuation
    closePunctuation = cat ClosePunctuation
    initialQuote = cat InitialQuote
    finalQuote = cat FinalQuote
    connectorPunctuation  = cat ConnectorPunctuation
    otherPunctuation = cat OtherPunctuation
    punctuation
              = dashPunctuation
        `union` openPunctuation
        `union` closePunctuation
        `union` initialQuote
        `union` finalQuote
        `union` connectorPunctuation
        `union` otherPunctuation
    

    Found in Data.CharSet.Unicode.Category from the package charset
    otherSymbol = cat OtherSymbol
    symbol
              = mathSymbol
        `union` currencySymbol
        `union` modifierSymbol
        `union` otherSymbol
    
    decimalNumber, letterNumber, otherNumber, number :: CharSet
    decimalNumber = cat DecimalNumber
    letterNumber = cat LetterNumber
    otherNumber = cat OtherNumber
    number
              = decimalNumber
        `union` letterNumber
        `union` otherNumber
    
    dashPunctuation, openPunctuation, closePunctuation, initialQuote,
      finalQuote, connectorPunctuation, otherPunctuation, punctuation :: CharSet
    
    dashPunctuation = cat DashPunctuation
    

    Found in Data.CharSet.Unicode.Category from the package charset
    modifierSymbol = cat ModifierSymbol
    otherSymbol = cat OtherSymbol
    symbol
              = mathSymbol
        `union` currencySymbol
        `union` modifierSymbol
        `union` otherSymbol
    
    decimalNumber, letterNumber, otherNumber, number :: CharSet
    decimalNumber = cat DecimalNumber
    letterNumber = cat LetterNumber
    otherNumber = cat OtherNumber
    number
              = decimalNumber
        `union` letterNumber
        `union` otherNumber
    
    dashPunctuation, openPunctuation, closePunctuation, initialQuote,
      finalQuote, connectorPunctuation, otherPunctuation, punctuation :: CharSet
    

    Found in Data.CharSet.Unicode.Category from the package charset
    separator
              = space
        `union` lineSeparator
        `union` paragraphSeparator
    
    mathSymbol, currencySymbol, modifierSymbol, otherSymbol, symbol :: CharSet
    mathSymbol = cat MathSymbol
    currencySymbol = cat CurrencySymbol
    modifierSymbol = cat ModifierSymbol
    otherSymbol = cat OtherSymbol
    symbol
              = mathSymbol
        `union` currencySymbol
        `union` modifierSymbol
        `union` otherSymbol
    
    decimalNumber, letterNumber, otherNumber, number :: CharSet
    decimalNumber = cat DecimalNumber
    letterNumber = cat LetterNumber
    otherNumber = cat OtherNumber
    

    Found in Data.CharSet.Unicode.Category from the package charset
    paragraphSeparator = cat ParagraphSeparator
    separator
              = space
        `union` lineSeparator
        `union` paragraphSeparator
    
    mathSymbol, currencySymbol, modifierSymbol, otherSymbol, symbol :: CharSet
    mathSymbol = cat MathSymbol
    currencySymbol = cat CurrencySymbol
    modifierSymbol = cat ModifierSymbol
    otherSymbol = cat OtherSymbol
    symbol
              = mathSymbol
        `union` currencySymbol
        `union` modifierSymbol
        `union` otherSymbol
    
    decimalNumber, letterNumber, otherNumber, number :: CharSet
    decimalNumber = cat DecimalNumber
    letterNumber = cat LetterNumber
    

    Found in Data.CharSet.Unicode.Category from the package charset
    lineSeparator = cat LineSeparator
    paragraphSeparator = cat ParagraphSeparator
    separator
              = space
        `union` lineSeparator
        `union` paragraphSeparator
    
    mathSymbol, currencySymbol, modifierSymbol, otherSymbol, symbol :: CharSet
    mathSymbol = cat MathSymbol
    currencySymbol = cat CurrencySymbol
    modifierSymbol = cat ModifierSymbol
    otherSymbol = cat OtherSymbol
    symbol
              = mathSymbol
        `union` currencySymbol
        `union` modifierSymbol
        `union` otherSymbol
    
    decimalNumber, letterNumber, otherNumber, number :: CharSet
    decimalNumber = cat DecimalNumber
    

    Found in Data.CharSet.Unicode.Category from the package charset
    spacingCombiningMark = cat SpacingCombiningMark
    enclosingMark = cat EnclosingMark
    mark
              = nonSpacingMark
        `union` spacingCombiningMark
        `union` enclosingMark
    
    space, lineSeparator, paragraphSeparator, separator :: CharSet
    space = cat Space
    lineSeparator = cat LineSeparator
    paragraphSeparator = cat ParagraphSeparator
    separator
              = space
        `union` lineSeparator
        `union` paragraphSeparator
    
    mathSymbol, currencySymbol, modifierSymbol, otherSymbol, symbol :: CharSet
    mathSymbol = cat MathSymbol
    currencySymbol = cat CurrencySymbol
    modifierSymbol = cat ModifierSymbol
    

    Found in Data.CharSet.Unicode.Category from the package charset
    nonSpacingMark = cat NonSpacingMark
    spacingCombiningMark = cat SpacingCombiningMark
    enclosingMark = cat EnclosingMark
    mark
              = nonSpacingMark
        `union` spacingCombiningMark
        `union` enclosingMark
    
    space, lineSeparator, paragraphSeparator, separator :: CharSet
    space = cat Space
    lineSeparator = cat LineSeparator
    paragraphSeparator = cat ParagraphSeparator
    separator
              = space
        `union` lineSeparator
        `union` paragraphSeparator
    
    mathSymbol, currencySymbol, modifierSymbol, otherSymbol, symbol :: CharSet
    mathSymbol = cat MathSymbol
    currencySymbol = cat CurrencySymbol
    

    Found in Data.CharSet.Unicode.Category from the package charset
    otherLetter = cat OtherLetter
    letter
              = letterAnd
        `union` modifierLetter
        `union` otherLetter
    
    -- Marks
    nonSpacingMark, spacingCombiningMark, enclosingMark, mark :: CharSet
    nonSpacingMark = cat NonSpacingMark
    spacingCombiningMark = cat SpacingCombiningMark
    enclosingMark = cat EnclosingMark
    mark
              = nonSpacingMark
        `union` spacingCombiningMark
        `union` enclosingMark
    
    space, lineSeparator, paragraphSeparator, separator :: CharSet
    space = cat Space
    lineSeparator = cat LineSeparator
    paragraphSeparator = cat ParagraphSeparator
    

    Found in Data.CharSet.Unicode.Category from the package charset
    modifierLetter  = cat ModifierLetter
    otherLetter = cat OtherLetter
    letter
              = letterAnd
        `union` modifierLetter
        `union` otherLetter
    
    -- Marks
    nonSpacingMark, spacingCombiningMark, enclosingMark, mark :: CharSet
    nonSpacingMark = cat NonSpacingMark
    spacingCombiningMark = cat SpacingCombiningMark
    enclosingMark = cat EnclosingMark
    mark
              = nonSpacingMark
        `union` spacingCombiningMark
        `union` enclosingMark
    
    space, lineSeparator, paragraphSeparator, separator :: CharSet
    space = cat Space
    lineSeparator = cat LineSeparator
    

    Found in Data.CharSet.Unicode.Category from the package charset
    -- Letter
    lowercaseLetter, uppercaseLetter, titlecaseLetter, letterAnd, modifierLetter, otherLetter, letter :: CharSet
    lowercaseLetter = cat LowercaseLetter
    uppercaseLetter = cat UppercaseLetter
    titlecaseLetter = cat TitlecaseLetter
    letterAnd = lowercaseLetter
        `union` uppercaseLetter
        `union` titlecaseLetter
    modifierLetter  = cat ModifierLetter
    otherLetter = cat OtherLetter
    letter
              = letterAnd
        `union` modifierLetter
        `union` otherLetter
    
    -- Marks
    nonSpacingMark, spacingCombiningMark, enclosingMark, mark :: CharSet
    nonSpacingMark = cat NonSpacingMark
    spacingCombiningMark = cat SpacingCombiningMark
    

    Found in Data.CharSet.Unicode.Category from the package charset
    cat category = build ((category ==) . generalCategory)
    
    -- Letter
    lowercaseLetter, uppercaseLetter, titlecaseLetter, letterAnd, modifierLetter, otherLetter, letter :: CharSet
    lowercaseLetter = cat LowercaseLetter
    uppercaseLetter = cat UppercaseLetter
    titlecaseLetter = cat TitlecaseLetter
    letterAnd = lowercaseLetter
        `union` uppercaseLetter
        `union` titlecaseLetter
    modifierLetter  = cat ModifierLetter
    otherLetter = cat OtherLetter
    letter
              = letterAnd
        `union` modifierLetter
        `union` otherLetter
    
    -- Marks
    nonSpacingMark, spacingCombiningMark, enclosingMark, mark :: CharSet
    nonSpacingMark = cat NonSpacingMark
    

    Found in Data.CharSet.Unicode.Category from the package charset
        go (' ':xs) = go xs
        go (x:xs) = x : go xs
        go [] = []
    
    cat :: GeneralCategory -> CharSet
    cat category = build ((category ==) . generalCategory)
    
    -- Letter
    lowercaseLetter, uppercaseLetter, titlecaseLetter, letterAnd, modifierLetter, otherLetter, letter :: CharSet
    lowercaseLetter = cat LowercaseLetter
    uppercaseLetter = cat UppercaseLetter
    titlecaseLetter = cat TitlecaseLetter
    letterAnd = lowercaseLetter
        `union` uppercaseLetter
        `union` titlecaseLetter
    modifierLetter  = cat ModifierLetter
    otherLetter = cat OtherLetter
    letter
              = letterAnd
        `union` modifierLetter
    

    Found in Data.CharSet.Unicode.Category from the package charset
        go ('_':xs) = go xs
        go (' ':xs) = go xs
        go (x:xs) = x : go xs
        go [] = []
    
    cat :: GeneralCategory -> CharSet
    cat category = build ((category ==) . generalCategory)
    
    -- Letter
    lowercaseLetter, uppercaseLetter, titlecaseLetter, letterAnd, modifierLetter, otherLetter, letter :: CharSet
    lowercaseLetter = cat LowercaseLetter
    uppercaseLetter = cat UppercaseLetter
    titlecaseLetter = cat TitlecaseLetter
    letterAnd = lowercaseLetter
        `union` uppercaseLetter
        `union` titlecaseLetter
    modifierLetter  = cat ModifierLetter
    otherLetter = cat OtherLetter
    letter
              = letterAnd
    

    Found in Data.HashSet from the package unordered-containers
    fromMap = HashSet
    
    -- | /O(n+m)/ Construct a set containing all elements from both sets.
    --
    -- To obtain good performance, the smaller set must be presented as
    -- the first argument.
    union :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
    union s1 s2 = HashSet $ H.union (asMap s1) (asMap s2)
    {-# INLINE union #-}
    
    -- TODO: Figure out the time complexity of 'unions'.
    
    -- | Construct a set containing all elements from a list of sets.
    unions :: (Eq a, Hashable a) => [HashSet a] -> HashSet a
    unions = List.foldl' union empty
    {-# INLINE unions #-}
    
    -- | /O(1)/ Return 'True' if this set is empty, 'False' otherwise.
    null :: HashSet a -> Bool
    null = H.null . asMap
    

    Found in Data.HashSet from the package unordered-containers
    -- | /O(1)/ Convert to the equivalent 'HashMap'.
    toMap :: HashSet a -> HashMap a ()
    toMap = asMap
    
    -- | /O(1)/ Convert from the equivalent 'HashMap'.
    fromMap :: HashMap a () -> HashSet a
    fromMap = HashSet
    
    -- | /O(n+m)/ Construct a set containing all elements from both sets.
    --
    -- To obtain good performance, the smaller set must be presented as
    -- the first argument.
    union :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
    union s1 s2 = HashSet $ H.union (asMap s1) (asMap s2)
    {-# INLINE union #-}
    
    -- TODO: Figure out the time complexity of 'unions'.
    
    -- | Construct a set containing all elements from a list of sets.
    unions :: (Eq a, Hashable a) => [HashSet a] -> HashSet a
    

    Found in Data.HashSet from the package unordered-containers
    -- | /O(1)/ Convert to the equivalent 'HashMap'.
    toMap :: HashSet a -> HashMap a ()
    toMap = asMap
    
    -- | /O(1)/ Convert from the equivalent 'HashMap'.
    fromMap :: HashMap a () -> HashSet a
    fromMap = HashSet
    
    -- | /O(n+m)/ Construct a set containing all elements from both sets.
    --
    -- To obtain good performance, the smaller set must be presented as
    -- the first argument.
    union :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
    union s1 s2 = HashSet $ H.union (asMap s1) (asMap s2)
    {-# INLINE union #-}
    
    -- TODO: Figure out the time complexity of 'unions'.
    
    -- | Construct a set containing all elements from a list of sets.
    

    Found in Data.HashSet from the package unordered-containers
    -- | /O(1)/ Convert to the equivalent 'HashMap'.
    toMap :: HashSet a -> HashMap a ()
    toMap = asMap
    
    -- | /O(1)/ Convert from the equivalent 'HashMap'.
    fromMap :: HashMap a () -> HashSet a
    fromMap = HashSet
    
    -- | /O(n+m)/ Construct a set containing all elements from both sets.
    --
    -- To obtain good performance, the smaller set must be presented as
    -- the first argument.
    union :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
    union s1 s2 = HashSet $ H.union (asMap s1) (asMap s2)
    {-# INLINE union #-}
    
    -- TODO: Figure out the time complexity of 'unions'.
    
    -- | Construct a set containing all elements from a list of sets.
    

    Found in Data.HashSet from the package unordered-containers
    {-# INLINABLE singleton #-}
    
    -- | /O(1)/ Convert to the equivalent 'HashMap'.
    toMap :: HashSet a -> HashMap a ()
    toMap = asMap
    
    -- | /O(1)/ Convert from the equivalent 'HashMap'.
    fromMap :: HashMap a () -> HashSet a
    fromMap = HashSet
    
    -- | /O(n+m)/ Construct a set containing all elements from both sets.
    --
    -- To obtain good performance, the smaller set must be presented as
    -- the first argument.
    union :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
    union s1 s2 = HashSet $ H.union (asMap s1) (asMap s2)
    {-# INLINE union #-}
    
    -- TODO: Figure out the time complexity of 'unions'.
    

    Found in Data.HashSet from the package unordered-containers
        {-# INLINE foldr #-}
    
    #if __GLASGOW_HASKELL__ >= 711
    instance (Hashable a, Eq a) => Semigroup (HashSet a) where
        (<>) = union
        {-# INLINE (<>) #-}
    #endif
    
    instance (Hashable a, Eq a) => Monoid (HashSet a) where
        mempty = empty
        {-# INLINE mempty #-}
    #if __GLASGOW_HASKELL__ >= 711
        mappend = (<>)
    #else
        mappend = union
    #endif
        {-# INLINE mappend #-}
    
    instance (Eq a, Hashable a, Read a) => Read (HashSet a) where
        readPrec = parens $ prec 10 $ do
    

    Found in Data.HashSet from the package unordered-containers
        compare (HashSet a) (HashSet b) = compare a b
        {-# INLINE compare #-}
    
    #if MIN_VERSION_base(4,9,0)
    instance Ord1 HashSet where
        liftCompare c (HashSet a) (HashSet b) = liftCompare2 c compare a b
    #endif
    
    instance Foldable.Foldable HashSet where
        foldr = Data.HashSet.foldr
        {-# INLINE foldr #-}
    
    #if __GLASGOW_HASKELL__ >= 711
    instance (Hashable a, Eq a) => Semigroup (HashSet a) where
        (<>) = union
        {-# INLINE (<>) #-}
    #endif
    
    instance (Hashable a, Eq a) => Monoid (HashSet a) where
        mempty = empty
    

    Found in Data.HashSet from the package unordered-containers
    --
    -- Many operations have a average-case complexity of /O(log n)/.  The
    -- implementation uses a large base (i.e. 16) so in practice these
    -- operations are constant time.
    
    module Data.HashSet
        (
          HashSet
    
        -- * Construction
        , empty
        , singleton
    
        -- * Combine
        , union
        , unions
    
        -- * Basic interface
        , null
        , size
    

    unionWith See 15 Occurences [+] Collapse [-]
    Found in Linear.Vector from the package linear
      liftI2 = IntMap.intersectionWith
      {-# INLINE liftI2 #-}
    
    instance Ord k => Additive (Map k) where
      zero = Map.empty
      {-# INLINE zero #-}
      liftU2 = Map.unionWith
      {-# INLINE liftU2 #-}
      liftI2 = Map.intersectionWith
      {-# INLINE liftI2 #-}
    
    instance (Eq k, Hashable k) => Additive (HashMap k) where
      zero = HashMap.empty
      {-# INLINE zero #-}
      liftU2 = HashMap.unionWith
      {-# INLINE liftU2 #-}
      liftI2 = HashMap.intersectionWith
      {-# INLINE liftI2 #-}
    
    instance Additive ((->) b) where
    

    Found in Linear.Vector from the package linear
      liftI2 = Prelude.zipWith
      {-# INLINE liftI2 #-}
    
    instance Additive IntMap where
      zero = IntMap.empty
      {-# INLINE zero #-}
      liftU2 = IntMap.unionWith
      {-# INLINE liftU2 #-}
      liftI2 = IntMap.intersectionWith
      {-# INLINE liftI2 #-}
    
    instance Ord k => Additive (Map k) where
      zero = Map.empty
      {-# INLINE zero #-}
      liftU2 = Map.unionWith
      {-# INLINE liftU2 #-}
      liftI2 = Map.intersectionWith
      {-# INLINE liftI2 #-}
    
    instance (Eq k, Hashable k) => Additive (HashMap k) where
    

    Found in Linear.Vector from the package linear
    instance Additive [] where
      zero = []
      {-# INLINE zero #-}
      liftU2 f = go where
        go (x:xs) (y:ys) = f x y : go xs ys
        go [] ys = ys
        go xs [] = xs
      {-# INLINE liftU2 #-}
      liftI2 = Prelude.zipWith
      {-# INLINE liftI2 #-}
    
    instance Additive IntMap where
      zero = IntMap.empty
      {-# INLINE zero #-}
      liftU2 = IntMap.unionWith
      {-# INLINE liftU2 #-}
      liftI2 = IntMap.intersectionWith
      {-# INLINE liftI2 #-}
    
    instance Ord k => Additive (Map k) where
    

    Found in Data.Semigroup.Union from the package reducers
    instance (Eq k, Hashable k) => HasUnionWith (HashMap k) where
      unionWith = HashMap.unionWith
    
    instance (Eq k, Hashable k) => HasUnionWith0 (HashMap k) where
      emptyWith = HashMap.empty
    
    -- | The 'Monoid' @('unionWith mappend','empty')@ for containers full of monoids.
    newtype UnionWith f m = UnionWith { getUnionWith :: f m }
    
    instance (HasUnionWith f, Semigroup m) => Semigroup (UnionWith f m) where
        UnionWith a <> UnionWith b = UnionWith (unionWith (<>) a b)
    
    instance (HasUnionWith0 f, Monoid m) => Monoid (UnionWith f m) where
        mempty = UnionWith emptyWith
        UnionWith a `mappend` UnionWith b = UnionWith (unionWith mappend a b)
    
    instance (HasUnionWith f, Semigroup m, Monoid m) => Reducer (f m) (UnionWith f m) where
        unit = UnionWith
    

    Found in Data.Semigroup.Union from the package reducers
    instance Ord k => HasUnionWith0 (Map k) where
      emptyWith = Map.empty
    
    instance (Eq k, Hashable k) => HasUnionWith (HashMap k) where
      unionWith = HashMap.unionWith
    
    instance (Eq k, Hashable k) => HasUnionWith0 (HashMap k) where
      emptyWith = HashMap.empty
    
    -- | The 'Monoid' @('unionWith mappend','empty')@ for containers full of monoids.
    newtype UnionWith f m = UnionWith { getUnionWith :: f m }
    
    instance (HasUnionWith f, Semigroup m) => Semigroup (UnionWith f m) where
        UnionWith a <> UnionWith b = UnionWith (unionWith (<>) a b)
    
    instance (HasUnionWith0 f, Monoid m) => Monoid (UnionWith f m) where
        mempty = UnionWith emptyWith
        UnionWith a `mappend` UnionWith b = UnionWith (unionWith mappend a b)
    

    Found in Data.Semigroup.Union from the package reducers
    instance HasUnionWith IntMap where
      unionWith = IntMap.unionWith
    
    instance HasUnionWith0 IntMap where
      emptyWith = IntMap.empty
    
    instance Ord k => HasUnionWith (Map k) where
      unionWith = Map.unionWith
    
    instance Ord k => HasUnionWith0 (Map k) where
      emptyWith = Map.empty
    
    instance (Eq k, Hashable k) => HasUnionWith (HashMap k) where
      unionWith = HashMap.unionWith
    
    instance (Eq k, Hashable k) => HasUnionWith0 (HashMap k) where
      emptyWith = HashMap.empty
    
    -- | The 'Monoid' @('unionWith mappend','empty')@ for containers full of monoids.
    

    Found in Data.Semigroup.Union from the package reducers
    instance HasUnionWith IntMap where
      unionWith = IntMap.unionWith
    
    instance HasUnionWith0 IntMap where
      emptyWith = IntMap.empty
    
    instance Ord k => HasUnionWith (Map k) where
      unionWith = Map.unionWith
    
    instance Ord k => HasUnionWith0 (Map k) where
      emptyWith = Map.empty
    
    instance (Eq k, Hashable k) => HasUnionWith (HashMap k) where
      unionWith = HashMap.unionWith
    
    instance (Eq k, Hashable k) => HasUnionWith0 (HashMap k) where
      emptyWith = HashMap.empty
    
    -- | The 'Monoid' @('unionWith mappend','empty')@ for containers full of monoids.
    

    Found in Data.Semigroup.Union from the package reducers
    {-# SPECIALIZE unionWith :: (a -> a -> a) -> IntMap a -> IntMap a -> IntMap a #-}
    {-# SPECIALIZE unionWith :: Ord k => (a -> a -> a) -> Map k a -> Map k a -> Map k a #-}
    {-# SPECIALIZE unionWith :: Eq k => (a -> a -> a) -> HashMap k a -> HashMap k a -> HashMap k a #-}
    
    class HasUnionWith f => HasUnionWith0 f where
      emptyWith :: f a
    
    instance HasUnionWith IntMap where
      unionWith = IntMap.unionWith
    
    instance HasUnionWith0 IntMap where
      emptyWith = IntMap.empty
    
    instance Ord k => HasUnionWith (Map k) where
      unionWith = Map.unionWith
    
    instance Ord k => HasUnionWith0 (Map k) where
      emptyWith = Map.empty
    
    instance (Eq k, Hashable k) => HasUnionWith (HashMap k) where
    

    Found in Data.Semigroup.Union from the package reducers
    {-# SPECIALIZE unionWith :: (a -> a -> a) -> IntMap a -> IntMap a -> IntMap a #-}
    {-# SPECIALIZE unionWith :: Ord k => (a -> a -> a) -> Map k a -> Map k a -> Map k a #-}
    {-# SPECIALIZE unionWith :: Eq k => (a -> a -> a) -> HashMap k a -> HashMap k a -> HashMap k a #-}
    
    class HasUnionWith f => HasUnionWith0 f where
      emptyWith :: f a
    
    instance HasUnionWith IntMap where
      unionWith = IntMap.unionWith
    
    instance HasUnionWith0 IntMap where
      emptyWith = IntMap.empty
    
    instance Ord k => HasUnionWith (Map k) where
      unionWith = Map.unionWith
    
    instance Ord k => HasUnionWith0 (Map k) where
      emptyWith = Map.empty
    
    instance (Eq k, Hashable k) => HasUnionWith (HashMap k) where
    

    Found in Data.Semigroup.Union from the package reducers
      traverse1 f (Union a) = Union <$> f a
    
    -- | Polymorphic containers that we can supply an operation to handle unions with
    class Functor f => HasUnionWith f where
      unionWith :: (a -> a -> a) -> f a -> f a -> f a
    
    {-# SPECIALIZE unionWith :: (a -> a -> a) -> IntMap a -> IntMap a -> IntMap a #-}
    {-# SPECIALIZE unionWith :: Ord k => (a -> a -> a) -> Map k a -> Map k a -> Map k a #-}
    {-# SPECIALIZE unionWith :: Eq k => (a -> a -> a) -> HashMap k a -> HashMap k a -> HashMap k a #-}
    
    class HasUnionWith f => HasUnionWith0 f where
      emptyWith :: f a
    
    instance HasUnionWith IntMap where
      unionWith = IntMap.unionWith
    
    instance HasUnionWith0 IntMap where
      emptyWith = IntMap.empty
    
    instance Ord k => HasUnionWith (Map k) where
    

    Found in Data.Semigroup.Union from the package reducers
      traverse1 f (Union a) = Union <$> f a
    
    -- | Polymorphic containers that we can supply an operation to handle unions with
    class Functor f => HasUnionWith f where
      unionWith :: (a -> a -> a) -> f a -> f a -> f a
    
    {-# SPECIALIZE unionWith :: (a -> a -> a) -> IntMap a -> IntMap a -> IntMap a #-}
    {-# SPECIALIZE unionWith :: Ord k => (a -> a -> a) -> Map k a -> Map k a -> Map k a #-}
    {-# SPECIALIZE unionWith :: Eq k => (a -> a -> a) -> HashMap k a -> HashMap k a -> HashMap k a #-}
    
    class HasUnionWith f => HasUnionWith0 f where
      emptyWith :: f a
    
    instance HasUnionWith IntMap where
      unionWith = IntMap.unionWith
    
    instance HasUnionWith0 IntMap where
      emptyWith = IntMap.empty
    
    instance Ord k => HasUnionWith (Map k) where
    

    Found in Data.Semigroup.Union from the package reducers
      traverse f (Union a) = Union <$> f a
    
    instance Foldable1 Union where
      foldMap1 f (Union a) = f a
    
    instance Traversable1 Union where
      traverse1 f (Union a) = Union <$> f a
    
    -- | Polymorphic containers that we can supply an operation to handle unions with
    class Functor f => HasUnionWith f where
      unionWith :: (a -> a -> a) -> f a -> f a -> f a
    
    {-# SPECIALIZE unionWith :: (a -> a -> a) -> IntMap a -> IntMap a -> IntMap a #-}
    {-# SPECIALIZE unionWith :: Ord k => (a -> a -> a) -> Map k a -> Map k a -> Map k a #-}
    {-# SPECIALIZE unionWith :: Eq k => (a -> a -> a) -> HashMap k a -> HashMap k a -> HashMap k a #-}
    
    class HasUnionWith f => HasUnionWith0 f where
      emptyWith :: f a
    
    instance HasUnionWith IntMap where
    

    Found in Data.Semigroup.Union from the package reducers
    instance Traversable Union where
      traverse f (Union a) = Union <$> f a
    
    instance Foldable1 Union where
      foldMap1 f (Union a) = f a
    
    instance Traversable1 Union where
      traverse1 f (Union a) = Union <$> f a
    
    -- | Polymorphic containers that we can supply an operation to handle unions with
    class Functor f => HasUnionWith f where
      unionWith :: (a -> a -> a) -> f a -> f a -> f a
    
    {-# SPECIALIZE unionWith :: (a -> a -> a) -> IntMap a -> IntMap a -> IntMap a #-}
    {-# SPECIALIZE unionWith :: Ord k => (a -> a -> a) -> Map k a -> Map k a -> Map k a #-}
    {-# SPECIALIZE unionWith :: Eq k => (a -> a -> a) -> HashMap k a -> HashMap k a -> HashMap k a #-}
    
    class HasUnionWith f => HasUnionWith0 f where
      emptyWith :: f a
    

    Found in Data.Semigroup.Union from the package reducers
    instance Traversable Union where
      traverse f (Union a) = Union <$> f a
    
    instance Foldable1 Union where
      foldMap1 f (Union a) = f a
    
    instance Traversable1 Union where
      traverse1 f (Union a) = Union <$> f a
    
    -- | Polymorphic containers that we can supply an operation to handle unions with
    class Functor f => HasUnionWith f where
      unionWith :: (a -> a -> a) -> f a -> f a -> f a
    
    {-# SPECIALIZE unionWith :: (a -> a -> a) -> IntMap a -> IntMap a -> IntMap a #-}
    {-# SPECIALIZE unionWith :: Ord k => (a -> a -> a) -> Map k a -> Map k a -> Map k a #-}
    {-# SPECIALIZE unionWith :: Eq k => (a -> a -> a) -> HashMap k a -> HashMap k a -> HashMap k a #-}
    
    class HasUnionWith f => HasUnionWith0 f where
      emptyWith :: f a
    

    Found in Data.Semigroup.Union from the package reducers
    instance Foldable Union where
     foldMap f (Union a) = f a
    
    instance Traversable Union where
      traverse f (Union a) = Union <$> f a
    
    instance Foldable1 Union where
      foldMap1 f (Union a) = f a
    
    instance Traversable1 Union where
      traverse1 f (Union a) = Union <$> f a
    
    -- | Polymorphic containers that we can supply an operation to handle unions with
    class Functor f => HasUnionWith f where
      unionWith :: (a -> a -> a) -> f a -> f a -> f a
    
    {-# SPECIALIZE unionWith :: (a -> a -> a) -> IntMap a -> IntMap a -> IntMap a #-}
    {-# SPECIALIZE unionWith :: Ord k => (a -> a -> a) -> Map k a -> Map k a -> Map k a #-}
    {-# SPECIALIZE unionWith :: Eq k => (a -> a -> a) -> HashMap k a -> HashMap k a -> HashMap k a #-}
    

    unionWithKey No usage example found for this symbol :( Collapse [-]
    unions See 4 Occurences [+] Collapse [-]
    Found in Data.HashSet from the package unordered-containers
    -- | /O(n+m)/ Construct a set containing all elements from both sets.
    --
    -- To obtain good performance, the smaller set must be presented as
    -- the first argument.
    union :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
    union s1 s2 = HashSet $ H.union (asMap s1) (asMap s2)
    {-# INLINE union #-}
    
    -- TODO: Figure out the time complexity of 'unions'.
    
    -- | Construct a set containing all elements from a list of sets.
    unions :: (Eq a, Hashable a) => [HashSet a] -> HashSet a
    unions = List.foldl' union empty
    {-# INLINE unions #-}
    
    -- | /O(1)/ Return 'True' if this set is empty, 'False' otherwise.
    null :: HashSet a -> Bool
    null = H.null . asMap
    {-# INLINE null #-}
    

    Found in Data.HashSet from the package unordered-containers
    fromMap = HashSet
    
    -- | /O(n+m)/ Construct a set containing all elements from both sets.
    --
    -- To obtain good performance, the smaller set must be presented as
    -- the first argument.
    union :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
    union s1 s2 = HashSet $ H.union (asMap s1) (asMap s2)
    {-# INLINE union #-}
    
    -- TODO: Figure out the time complexity of 'unions'.
    
    -- | Construct a set containing all elements from a list of sets.
    unions :: (Eq a, Hashable a) => [HashSet a] -> HashSet a
    unions = List.foldl' union empty
    {-# INLINE unions #-}
    
    -- | /O(1)/ Return 'True' if this set is empty, 'False' otherwise.
    null :: HashSet a -> Bool
    null = H.null . asMap
    

    Found in Data.HashSet from the package unordered-containers
    fromMap :: HashMap a () -> HashSet a
    fromMap = HashSet
    
    -- | /O(n+m)/ Construct a set containing all elements from both sets.
    --
    -- To obtain good performance, the smaller set must be presented as
    -- the first argument.
    union :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
    union s1 s2 = HashSet $ H.union (asMap s1) (asMap s2)
    {-# INLINE union #-}
    
    -- TODO: Figure out the time complexity of 'unions'.
    
    -- | Construct a set containing all elements from a list of sets.
    unions :: (Eq a, Hashable a) => [HashSet a] -> HashSet a
    unions = List.foldl' union empty
    {-# INLINE unions #-}
    
    -- | /O(1)/ Return 'True' if this set is empty, 'False' otherwise.
    null :: HashSet a -> Bool
    

    Found in Data.HashSet from the package unordered-containers
    -- Many operations have a average-case complexity of /O(log n)/.  The
    -- implementation uses a large base (i.e. 16) so in practice these
    -- operations are constant time.
    
    module Data.HashSet
        (
          HashSet
    
        -- * Construction
        , empty
        , singleton
    
        -- * Combine
        , union
        , unions
    
        -- * Basic interface
        , null
        , size
        , member
    

    update No usage example found for this symbol :( Collapse [-]
    HashMap No usage example found for this symbol :( Collapse [-]