File: let_punning.ml

package info (click to toggle)
ocamlformat 0.29.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 14,820 kB
  • sloc: ml: 65,176; pascal: 4,877; lisp: 229; sh: 217; makefile: 121
file content (23 lines) | stat: -rw-r--r-- 362 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
let ( let* ) x f = f x

let ( and* ) a b = (a, b)

let x = 1

and y = 2

and z = 3

let p =
  let* x = x and* y and* z = z in
  (x, y, z)

let q =
  let%foo x and y = y and z in
  (x, y, z)

let r = let* (* 1 *) x (* 2 *) = (* 3 *) x (* 4 *)
and* (* 5 *) y (* 6 *) in (x, y)

let s = let%foo (* 1 *) x (* 2 *) = (* 3 *) x (* 4 *)
and (* 5 *) y (* 6 *) in (x, y)