Skip to content

Instantly share code, notes, and snippets.

View dinosaure's full-sized avatar

Calascibetta Romain dinosaure

View GitHub Profile
type ('f, 't, 'is) kind =
| Exn : ('a, 'a, exn) kind
| Opt : ('a, 'a option, opt) kind
| Res : ('a, ('a, [ `Msg of string ]) result, res) kind
and exn = E
and opt = O
and res = R
let exn = Exn
let opt = Opt
module Peano = struct
type z = Zero
type 'a s = Succ
type 'a t =
| Z : z t
| S : 'a t -> 'a s t
and zero = z t
let zero : z t = Z
type 'a fmt = Format.formatter -> 'a -> unit
type 'a io = 'a
(* Git types. *)
type store = unit
type hash = string
type reference = string
type host = string
type path = string list
@dinosaure
dinosaure / log
Created September 17, 2018 08:25
{d = { last = false; hold = 0; bits = 0; o_off = 0; o_pos = 0; o_len = 0;
i_off = 0; i_pos = 0; i_len = 0; write = 0; state = Last;
window = #window; }; z = (Header #fun);}
{d = { last = false; hold = 0; bits = 0; o_off = 0; o_pos = 0; o_len = 0;
i_off = 0; i_pos = 0; i_len = 1725; write = 0; state = Last;
window = #window; }; z = (Header #fun);}
{d = { last = false; hold = 0; bits = 0; o_off = 0; o_pos = 0; o_len = 0;
i_off = 0; i_pos = 2; i_len = 1725; write = 0; state = Last;
window = #window; }; z = Inflate;}
{d = { last = false; hold = 74; bits = 7; o_off = 0; o_pos = 0; o_len = 0;
diff --git a/src/lib_stdlib/dune b/src/lib_stdlib/dune
index 9544949..d60e9ac 100644
--- a/src/lib_stdlib/dune
+++ b/src/lib_stdlib/dune
@@ -8,7 +8,7 @@
re
zarith
lwt
- lwt.log)
+ lwt_log)
CAMLprim value caml_ba_overlap(value va, value vb)
{
CAMLparam2 (va, vb);
CAMLlocal1 (res);
struct caml_ba_array * a = Caml_ba_array_val(va);
struct caml_ba_array * b = Caml_ba_array_val(vb);
void *src_a = a->data;
void *src_b = b->data;
let () = Printexc.record_backtrace true
type t =
{ dims : int array
; memory : int * int } (* absolute position * absolute position *)
let ptr t = fst t.memory
let len t = snd t.memory - fst t.memory
let dims t = Array.length t.dims
type ('a, 'b) bigarray = ('a, 'b, Bigarray.c_layout) Bigarray.Array1.t
external is_a_sub :
('a, 'b) bigarray -> int ->
('a, 'b) bigarray -> int -> bool = "caml_bigarray_is_a_sub" [@@noalloc]
external bigarray_physically_equal :
('a, 'b) bigarray ->
('a, 'b) bigarray -> bool = "caml_bigarray_physically_equal" [@@noalloc]
[@@@warning "-32"]
(* (c) Romain Calascibetta *)
let ( <.> ) f g = fun x -> f (g x)
module type S = sig
type 'a s
type ('r, 'a) t
val run : ('r, 'a) t -> ('a -> 'r s) -> 'r s
val map : ('r s -> 'r s) -> ('r, 'a) t -> ('r, 'a) t
diff --git a/deflate.c b/deflate.c
index 1ec7614..088d272 100644
--- a/deflate.c
+++ b/deflate.c
@@ -85,7 +85,7 @@ local block_state deflate_rle OF((deflate_state *s, int flush));
local block_state deflate_huff OF((deflate_state *s, int flush));
local void lm_init OF((deflate_state *s));
local void putShortMSB OF((deflate_state *s, uInt b));
-local void flush_pending OF((z_streamp strm));
+void flush_pending OF((z_streamp strm));