Hoogle Search

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

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

  1. data NESet a

    nonempty-containers Data.Set.NonEmpty.Internal

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

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

  2. NESet :: a -> !Set a -> NESet a

    nonempty-containers Data.Set.NonEmpty.Internal

    No documentation available.

  3. getMergeNESet :: MergeNESet a -> NESet a

    nonempty-containers Data.Set.NonEmpty.Internal

    No documentation available.

  4. insertMaxSet :: a -> Set a -> Set a

    nonempty-containers Data.Set.NonEmpty.Internal

    O(log n). Insert new value into a set where values are /strictly less than the new value. That is, the new value must be strictly greater than all values present in the Set. The precondition is not checked./ While this has the same asymptotics as Data.Set.insert, it saves a constant factor for value comparison (so may be helpful if comparison is expensive) and also does not require an Ord instance for the value type.

  5. insertMinSet :: a -> Set a -> Set a

    nonempty-containers Data.Set.NonEmpty.Internal

    O(log n). Insert new value into a set where values are strictly greater than the new values That is, the new value must be strictly less than all values present in the Set. /The precondition is not checked./ While this has the same asymptotics as Data.Set.insert, it saves a constant factor for value comparison (so may be helpful if comparison is expensive) and also does not require an Ord instance for the value type.

  6. nesSet :: NESet a -> !Set a

    nonempty-containers Data.Set.NonEmpty.Internal

    No documentation available.

  7. nonEmptySet :: Set a -> Maybe (NESet a)

    nonempty-containers Data.Set.NonEmpty.Internal

    O(log n). Smart constructor for an NESet from a Set. Returns Nothing if the Set was originally actually empty, and Just n with an NESet, if the Set was not empty. nonEmptySet and maybe empty toSet form an isomorphism: they are perfect structure-preserving inverses of eachother. See IsNonEmpty for a pattern synonym that lets you "match on" the possiblity of a Set being an NESet.

    nonEmptySet (Data.Set.fromList [3,5]) == Just (fromList (3:|[5]))
    

  8. toSet :: NESet a -> Set a

    nonempty-containers Data.Set.NonEmpty.Internal

    O(log n). Convert a non-empty set back into a normal possibly-empty map, for usage with functions that expect Set. Can be thought of as "obscuring" the non-emptiness of the set in its type. See the IsNotEmpty pattern. nonEmptySet and maybe empty toSet form an isomorphism: they are perfect structure-preserving inverses of eachother.

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

  9. nodeInfoSetTo :: To k -> NodeInfo k v -> NodeInfo k v

    patch Data.Patch.MapWithMove

    Set the To field of a NodeInfo

  10. nodeInfoSetTo :: To k -> NodeInfo k v -> NodeInfo k v

    patch Data.Patch.MapWithPatchingMove

    Set the To field of a NodeInfo

Page 127 of many | Previous | Next