Commits

bergsoe committed 9fef690

[map2] utility.

  • Participants
  • Parent commits dbe453a

Comments (0)

Files changed (1)

src/PaplSampler.mli

 
 (** {2 Combinators} *)
 
+val map2 : ('a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t
+(** Map a function onto the values of two samplers.
+
+    The sampler [s = map2 f sa sb] returns values [f a b] where [a] and [b] are
+    sampled from [sa] and [sb].
+
+    If either [sa] or [sb] becomes empty, then [s] is empty too.
+
+    If [f] doesn't like the values [a] and [b] it can prematurely signal the end
+    of the stream by raising [BatEnum.No_more_elements].
+*)
+
 val pair : 'a t -> 'a pair_t t
 (** Pairs of values extracted from a single-element sampler.