measures-0.1.0.1: An abstraction for (tuples of) measured quantities
Safe Haskell None
Language Haskell2010

Data.Measure

Description

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.

Synopsis

Documentation

(<=) :: Measure a => a -> a -> Bool infix 4 Source #

The partial order induced by min

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

(>=) :: Measure a => a -> a -> Bool infix 4 Source #

The partial order induced by max

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

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

snd . splitAt measure limit , with a bit less allocation

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

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.

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

fst . splitAt measure limit , but non-strict