package levenshtein

  1. Overview
  2. Docs

Generic array type.

get does not need to check the range.

You can use Array or String with overriding get with Array.unsafe_get or String.unsafe_get respectively, i.e.:

module A = struct type elem = <YOUR ELEMENT TYPE> type t = elem array let compare = ... let get = unsafe_get let size = Array.size end

module A' = struct type elem = char type t = string let compare (c1 : char) c2 = compare c1 c2 let get = String.unsafe_get let size = String.length end

type t

Type of arrays

type elem

Type of the elements of arrays

val compare : elem -> elem -> int
val get : t -> int -> elem

no need of range checking

val size : t -> int
OCaml

Innovation. Community. Security.