This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type ('a, 'b) tree = | |
| Empty | |
| Node of | |
{ left : ('a, 'b) tree | |
; right : ('a, 'b) tree | |
; key : 'a | |
; value : 'b | |
; height : int | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* HAMT v.s. AVL benchmark. | |
test for their usage as string map. | |
usage: | |
> ocamlopt HAMT.ml -o <executable-name> | |
> <executable-name> (avl|hamt) (random|ordered) <key-length> | |
time data of the form: | |
<tree-size> <add-time> <find-time> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(library | |
(name ppx_poly_gadt) | |
(kind ppx_rewriter) | |
(preprocess | |
(pps ppxlib.metaquot)) | |
(libraries ppxlib)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let dummy_arr = [||]; | |
module type ELT = { | |
type t; | |
let uninitialized: t; | |
}; | |
module Make = (Elt: ELT) => { | |
type t('a) = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type ('data, 'index) node = | |
{ left : ('data, 'index) node option | |
; right : ('data, 'index) node option | |
; priority : int | |
; mutable data : 'data | |
; mutable index : 'index | |
} | |
type ('a, 'b) t = ('a, 'b) node option |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* Doubly linked list *) | |
type 'a node = { mutable prev : 'a node; mutable next : 'a node; data : 'a } | |
type 'a list = List of 'a node [@@unboxed] | |
let create () = | |
let rec root = { prev = root; next = root; data = Obj.magic `Dummy } in | |
List root | |
let iter (List root) f = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { assert } from "./Errors"; | |
export type treap<a, b> = node<a, b> | undefined; | |
export type node<a, b> = { | |
left: treap<a, b>; | |
right: treap<a, b>; | |
priority: number; | |
data: a; | |
subtreeData: b; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Generated by ReScript, PLEASE EDIT WITH CARE | |
import * as Caml_array from "rescript/lib/es6/caml_array.js"; | |
function cons(_record, _map) { | |
while(true) { | |
var map = _map; | |
var record = _record; | |
if (!map) { | |
return { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type 'a t = { | |
f : unit -> 'a Lwt.t; | |
} | |
type 'a task = < | |
is_running : bool; | |
is_cancelled : bool; | |
result : 'a option; | |
error : (exn * Printexc.raw_backtrace) option; | |
done_ : unit Lwt.t; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%{ | |
[@@@warning "-39"] | |
%} | |
%start <unit> file | |
%% | |
file: | |
| MODULE UIDENT item* EOF {} |
NewerOlder