Hoogle Search

Within Stackage Nightly 2025-10-09 (ghc-9.12.2)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. fromSet :: (Int -> a) -> IntSet -> MonoidalIntMap a

    monoidal-containers Data.IntMap.Monoidal.Strict

    No documentation available.

  2. keysSet :: MonoidalIntMap a -> IntSet

    monoidal-containers Data.IntMap.Monoidal.Strict

    No documentation available.

  3. fromSet :: (k -> a) -> Set k -> MonoidalMap k a

    monoidal-containers Data.Map.Monoidal

    No documentation available.

  4. keysSet :: MonoidalMap k a -> Set k

    monoidal-containers Data.Map.Monoidal

    No documentation available.

  5. fromSet :: (k -> a) -> Set k -> MonoidalMap k a

    monoidal-containers Data.Map.Monoidal.Strict

    No documentation available.

  6. keysSet :: MonoidalMap k a -> Set k

    monoidal-containers Data.Map.Monoidal.Strict

    No documentation available.

  7. fromSet :: (Key -> a) -> NEIntSet -> NEIntMap a

    nonempty-containers Data.IntMap.NonEmpty

    O(n). Build a non-empty map from a non-empty set of keys and a function which for each key computes its value.

    fromSet (\k -> replicate k 'a') (Data.Set.NonEmpty.fromList (3 :| [5])) == fromList ((5,"aaaaa") :| [(3,"aaa")])
    

  8. keysSet :: NEIntMap a -> NEIntSet

    nonempty-containers Data.IntMap.NonEmpty

    O(n). The non-empty set of all keys of the map.

    keysSet (fromList ((5,"a") :| [(3,"b")])) == Data.Set.NonEmpty.fromList (3 :| [5])
    

  9. data NEIntSet

    nonempty-containers Data.IntSet.NonEmpty

    A non-empty (by construction) set of integers. At least one value exists in an NEIntSet a at all times. Functions that take an NEIntSet can safely operate on it with the assumption that it has at least one item. Functions that return an NEIntSet provide an assurance that the result has at least one item. Data.IntSet.NonEmpty re-exports the API of Data.IntSet, faithfully reproducing asymptotics, typeclass constraints, and semantics. Functions that ensure that input and output sets are both non-empty (like insert) return NEIntSet, but functions that might potentially return an empty map (like delete) return a IntSet instead. You can directly construct an NEIntSet with the API from Data.IntSet.NonEmpty; it's more or less the same as constructing a normal IntSet, except you don't have access to empty. There are also a few ways to construct an NEIntSet from a IntSet:

    1. The nonEmptySet smart constructor will convert a IntSet a into a Maybe (NEIntSet a), returning Nothing if the original IntSet was empty.
    2. You can use the insertIntSet family of functions to insert a value into a IntSet to create a guaranteed NEIntSet.
    3. You can use the IsNonEmpty and IsEmpty patterns to "pattern match" on a IntSet to reveal it as either containing a NEIntSet or an empty map.
    4. withNonEmpty offers a continuation-based interface for deconstructing a IntSet and treating it as if it were an NEIntSet.
    You can convert an NEIntSet into a IntSet with toSet or IsNonEmpty, essentially "obscuring" the non-empty property from the type.

  10. insertSet :: Key -> IntSet -> NEIntSet

    nonempty-containers Data.IntSet.NonEmpty

    O(log n). Convert a IntSet into an NEIntSet by adding a value. Because of this, we know that the set must have at least one element, and so therefore cannot be empty. See insertSetMin for a version that is constant-time if the new value is strictly smaller than all values in the original set

    insertSet 4 (Data.IntSet.fromList [5, 3]) == fromList (3 :| [4, 5])
    insertSet 4 Data.IntSet.empty == singleton 4 "c"
    

Page 124 of many | Previous | Next