package mopsa

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Lift comparison to composed data-structure (pairs, lists, etc.).

val compose : (unit -> int) list -> int

compose cl applies a list of comparison functions cl in sequence and stops when encountering the first non-zero result.

val list : ('a -> 'b -> int) -> 'c list -> 'c list -> int

list p lifts the 'a compare function p to 'a list

val pair : ('a -> 'b -> int) -> ('c -> 'd -> int) -> ('e * 'f) -> ('g * 'h) -> int

pair p lifts the 'a compare function p, 'b compare function q to 'a * 'b

val triple : ('a -> 'b -> int) -> ('c -> 'd -> int) -> ('e -> 'f -> int) -> ('g * 'h * 'i) -> ('j * 'k * 'l) -> int

triple p lifts the 'a compare function p, 'b compare function q, 'c compare function r to 'a * 'b * 'c

val quadruple : ('a -> 'b -> int) -> ('c -> 'd -> int) -> ('e -> 'f -> int) -> ('g -> 'h -> int) -> ('i * 'j * 'k * 'l) -> ('m * 'n * 'o * 'p) -> int
val option : ('a -> 'b -> int) -> 'c option -> 'c option -> int

option p lifts p: 'a -> 'a -> int to 'a option -> 'a option -> int

OCaml

Innovation. Community. Security.