HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

Moduletdigest-0.3.1Haskell2010

Data.TDigest.Postprocess

Contents
  1. Histogram
  2. Quantiles
  3. Mean & variance
  4. CDF
  5. Affine
Synopsis
  • Packagetdigest-0.3.1
  • Exports10
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceInternal.hs

Histogram

classclass Affine f => HasHistogram a (f :: Type -> Type) | a -> f where

Types from which we can extract histogram.

Methods

Instances5HasHistogram
datadata HistBin

Histogram bin

Constructors

Instances3Show, HasHistogram

Quantiles

Mean & variance

As we have "full" histogram, we can calculate other statistical variables.

valuemean :: HasHistogram a f => a -> f Double

Mean.

Example1 expression
mean (Tree.tdigest [1..100] :: Tree.TDigest 10)Just 50.5

Note: if you only need the mean, calculate it directly.

CDF

valuecdf :: HasHistogram a f => Double -> a -> Double

Cumulative distribution function.

Note: if this is the only thing you need, it's more efficient to count this directly.

Affine

classclass Traversable t => Affine (t :: Type -> Type) where

Affine containers, i.e. containing at most 1 element

This class doesn't have traverse analogie as it would require using Pointed which is disputed type class.

traverseAff :: Pointed f => (a -> f b) -> t a -> f (t b)

Methods

Instances4Affine
  • Affine IdentityDefined in tdigest-0.3.1 · Data.TDigest.Postprocess.Internal
  • Affine MaybeDefined in tdigest-0.3.1 · Data.TDigest.Postprocess.Internal
  • Affine ProxyDefined in tdigest-0.3.1 · Data.TDigest.Postprocess.Internal
  • (Affine f, Affine g) => Affine (Compose f g)Defined in tdigest-0.3.1 · Data.TDigest.Postprocess.Internal

    Composition of Affine containers is Affine