HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulestatistics-0.16.3.0Haskell2010

Statistics.Function

Useful functions.

  • 13 values

Scanning

1 declaration

Sorting

4 declarations
valuepartialSort
  1. :: (Vector v e, Ord e)
  2. => Int

    The number k of least elements.

  3. -> v e
  4. -> v e
#

Partially sort a vector, such that the least k elements will be at the front.

Indexing

2 declarations

Bit twiddling

1 declaration

Efficiently compute the next highest power of two for a non-negative integer. If the given value is already a power of two, it is returned unchanged. If negative, zero is returned.

Comparison

1 declaration
valuewithin
  1. :: Int

    Number of ULPs of accuracy desired.

  2. -> Double
  3. -> Double
  4. -> Bool
#

Compare two Double values for approximate equality, using Dawson's method.

The required accuracy is specified in ULPs (units of least precision). If the two numbers differ by the given number of ULPs or less, this function returns True.

Arithmetic

1 declaration

Vectors

1 declaration

Combinators

2 declarations
valuefor :: Monad m => Int -> Int -> (Int -> m ()) -> m ()
#

Simple for loop. Counts from start to end-1.

valuerfor :: Monad m => Int -> Int -> (Int -> m ()) -> m ()
#

Simple reverse-for loop. Counts from start-1 to end (which must be less than start).