# code-block-pro/1.28.0/build/shiki/samples/ocaml.sample

Code Block Pro – Beautiful Syntax Highlighting, version 1.28.0. 24 lines.

- Page: https://pluginprobe.com/plugins/code-block-pro/1.28.0/code/build/shiki/samples/ocaml.sample
- Raw: https://pluginprobe.com/plugins/code-block-pro/1.28.0/raw/build/shiki/samples/ocaml.sample
- Modified: 2023-09-03T01:04:34+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/code-block-pro/1.28.0/code/build/shiki/samples/ocaml.sample#L10-L20`.

```

utop # type person = { name: string ; age: int ; human : bool };;
type person = { name : string; age : int; human : bool; }

utop # let david = { name = "david" ; age = 32 ; human = false };;
val david : person = {name = "david"; age = 32; human = false}

utop # let mary = { david with name = "mary" };;
val mary : person = {name = "mary"; age = 32; human = false}

utop # let toggle_human (p : person) = { p with human = not p.human };;
val toggle_human : person -> person = <fun>

utop # let () =
  let david' = toggle_human david in
  if david'.human then
    print_endline "david is human"
  else
    print_endline "david is not human"
;;
david is human

(** From https://o1-labs.github.io/ocamlbyexample/basics-records.html *)

```
