Base
Refernces: Jane Street Blog OPAM Base
The examples below use base v0.18~preview.130.72+278
Setup
1#require "base";;
2open Base;;Create a list
1let l = [1;2;3];;
2#typeof "l";;val l : int list1let b_l = Base.List.of_list l;;
2#typeof "b_l";;val b_l : int Base.List.tList.compare
1let l = [1;2];;
2let m = [3;4];;
3
4List.compare Int.compare l m;;- : int/2 = -11List.compare Int.compare l l;;- : int/2 = 0ppx_compare
Additional setup…
#require "ppx_jane";;1[%compare: int list] l m;;- : int = -1List.sexp_of_t
1List.sexp_of_t Int.sexp_of_t l;;- : Sexplib0.Sexp.t =
Sexplib0__.Sexp.List [Sexplib0__.Sexp.Atom "1"; Sexplib0__.Sexp.Atom "2"]