Module Sink.Applicative

Module that implements the "Applicative" interface.

type ('input, 'a) t = ('input'a) sink
val pure : 'a -> ('b'a) t
val (<*>) : ('a'b -> 'c) t -> ('a'b) t -> ('a'c) t

f <*> sink is a function application for functions contained in a sink.

This operator can be combined with (<@>) to run multiple sinks at the same time:

let mean = Sink.((/) <@> sum <*> len)

Which is equivalent to the following version without operators:

let mean = Sink.(map (fun (total, count) -> total / count) (both sum len))