package forester

  1. Overview
  2. Docs
A tool for tending mathematical forests

Install

Dune Dependency

Authors

Maintainers

Sources

3.1.0.tar.gz
md5=3512b493a31b0d1073ba4e48e8058493
sha512=b6e5ad2f86132d1874cb943546375e2f1b987a0c65628d71f17827f1ff7435df476c86fb135b34b3ff302f99ea54a21b90730257e12aa41cce170fae57c422b0

doc/src/forester.prelude/Compare.ml.html

Source file Compare.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
let under f compare x y =
  compare (f x) (f y)

let cascade compare0 compare1 x y =
  match compare0 x y with
  | 0 -> compare1 x y
  | i -> i

let option compare x y =
  match x, y with
  | None, Some _ -> -1
  | Some _, None -> 1
  | None, None -> 0
  | Some x, Some y -> compare x y

let sort_map f compare xs =
  List.sort compare @@ List.map f xs
OCaml

Innovation. Community. Security.