HORIZON HASKELLDocslts/ghc-9.14.xd82dee82026-10-12Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · d82dee8 · 2026-10-12

Modulemeasures-0.1.0.3Haskell2010

Data.Measure

Combinators for a possibly-multidimensional measurement

The type (Age, Height) is archetypal example of Measure. It's typically a fixed-length vector of non-negative " measurements ".

The anticipated use-cases involve some notion of a capacity that is limited on a per-dimension basis. Thus the measure of each included candidate quantifies how much of that capacity the candidate would occupy. See eg splitAt.

See the Measure class for more.

  • 5 values
  • Packagemeasures-0.1.0.3
  • Exports5
  • LanguageHaskell2010
  • LicenceApache-2.0
  • SourceMeasure.hs
value(<=) :: Measure a => a -> a -> Bool
#

The partial order induced by min

It's only true if every component on the left is <= the corresponding component on the right.

value(>=) :: Measure a => a -> a -> Bool
#

The partial order induced by max

It's only true if every component on the left is >= the corresponding component on the right.

valuedrop :: Measure a => (e -> a) -> a -> [e] -> [e]
#

snd . splitAt measure limit, with a bit less allocation

valuesplitAt :: Measure a => (e -> a) -> a -> [e] -> ([e], [e])
#

Split a list once a prefix fills up the given capacity

Note that this just splits the given list; it does not attempt anything clever like bin-packing etc.

valuetake :: Measure a => (e -> a) -> a -> [e] -> [e]
#

fst . splitAt measure limit, but non-strict