HORIZON HASKELLDocslts/ghc-10.0.xaa25b892026-10-10Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · aa25b89 · 2026-10-10

Modulerio-0.1.25.0Haskell2010

RIO.Set.Unchecked

This module contains functions from Data.Set that have unchecked preconditions on their input. If these preconditions are not satisfied, the data structure may end up in an invalid state and other operations may misbehave. Import as:

import qualified RIO.Set.Unchecked as Set'
  • 5 values
  • Packagerio-0.1.25.0
  • Exports5
  • LanguageHaskell2010
  • LicenceMIT
  • SourceUnchecked.hs

Map

1 declaration
valuemapMonotonic :: (a -> b) -> Set a -> Set b
#

O(n). mapMonotonic f s == map f s, but works only when f is strictly increasing. Semi-formally, we have:

and [x < y ==> f x < f y | x <- ls, y <- ls]
                    ==> mapMonotonic f s == map f s
    where ls = toList s

Warning: This function should be used only if f is monotonically strictly increasing. This precondition is not checked. Use map if the precondition may not hold.

Ordered list

4 declarations
valuefromAscList :: Eq a => [a] -> Set a
#

O(n). Build a set from an ascending list in linear time.

Warning: This function should be used only if the elements are in non-decreasing order. This precondition is not checked. Use fromList if the precondition may not hold.

valuefromDescList :: Eq a => [a] -> Set a
#

O(n). Build a set from a descending list in linear time.

Warning: This function should be used only if the elements are in non-increasing order. This precondition is not checked. Use fromList if the precondition may not hold.

valuefromDistinctAscList :: [a] -> Set a
#

O(n). Build a set from an ascending list of distinct elements in linear time.

Warning: This function should be used only if the elements are in strictly increasing order. This precondition is not checked. Use fromList if the precondition may not hold.

valuefromDistinctDescList :: [a] -> Set a
#

O(n). Build a set from a descending list of distinct elements in linear time.

Warning: This function should be used only if the elements are in strictly decreasing order. This precondition is not checked. Use fromList if the precondition may not hold.