package primavera

  1. Overview
  2. Docs

Module S1.SyntaxSource

Bindings operators.

Sourceval (let+) : ('a, 'handler) t -> ('a -> 'b) -> ('b, 'handler) t

let+ x = m in f x is map (fun x -> f x) m.

(binding version of map)

Sourceval (and+) : ('a, 'handler) t -> ('b, 'handler) t -> ('a * 'b, 'handler) t

let+ x = m and+ y = n in f x y is map (fun (x, y) -> f x y) (zip m n).

(binding version of zip)

Sourceval (let*) : ('a, 'handler) t -> ('a -> ('b, 'handler) t) -> ('b, 'handler) t

let* x = m in f x is bind m (fun x -> f x).

(binding version of bind)

Sourceval (and*) : ('a, 'handler) t -> ('b, 'handler) t -> ('a * 'b, 'handler) t

let* x = m and* y = n in f x y is bind (zip m n) (fun (x, y) -> f x y).

(binding version of zip)