package cpm

  1. Overview
  2. Docs
type 'a t
val create : int -> 'a t

create n creates a 'a Top_keeper.t that will keep up to n best scoring elements

val add : 'a -> float -> 'a t -> 'a t

add elt score t add elt with score to the top_keeper t (if the score is good enough or if the top_keeper doesn't hold enough elements yet)

val high_scores_first : 'a t -> (float * 'a) list

high_scores_first t retrieves the n best scores from t (with associated elements)

OCaml

Innovation. Community. Security.