31 lines
522 B
Text
31 lines
522 B
Text
#require "psq"
|
|
#directory "_build/src"
|
|
#load "lru.cma"
|
|
#require "fmt"
|
|
|
|
module I = struct
|
|
type t = int
|
|
let compare (a: int) b = compare a b
|
|
let hash = Hashtbl.hash
|
|
let equal = (=)
|
|
let weight a = a
|
|
end
|
|
|
|
module F = Lru.F.Make (I) (I)
|
|
module M = Lru.M.Make (I) (I)
|
|
|
|
let r _ = Random.int 100
|
|
|
|
let init f n =
|
|
let rec go i =
|
|
if i = n then [] else let x = f i in x :: go (i + 1) in
|
|
go 0
|
|
|
|
let ppf = F.pp_dump Fmt.int Fmt.int
|
|
let ppm = M.pp_dump Fmt.int Fmt.int
|
|
|
|
;;
|
|
|
|
#install_printer ppf;;
|
|
#install_printer ppm;;
|
|
|