package stdune

  1. Overview
  2. Docs
Dune's unstable standard library

Install

Dune Dependency

Authors

Maintainers

Sources

dune-3.19.1.tbz
sha256=a10386f980cda9417d1465466bed50dd2aef9c93b9d06a0f7feeedb0a1541158
sha512=d1622939713133a1f28617229896298d6ef194c48a47d011e4b752490fc83893cc920a8395d7ac60bc384a6c9b233ebf0665f38f74f2774a983e9d3b241a7746

doc/src/stdune/bool.ml.html

Source file bool.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
let compare x y =
  match x, y with
  | true, true | false, false -> Ordering.Eq
  | true, false -> Gt
  | false, true -> Lt
;;

include Comparator.Operators (struct
    type nonrec t = bool

    let compare = compare
  end)

let to_string = string_of_bool
let of_string s = bool_of_string_opt s
let to_dyn t = Dyn.Bool t

let[@inline always] hash = function
  | true -> 1
  | false -> 0
;;
OCaml

Innovation. Community. Security.