Skip to content

Instantly share code, notes, and snippets.

@dbuenzli
dbuenzli / BRZO
Last active July 16, 2026 22:41
Really leaky effect handling with 5.5
;
@dbuenzli
dbuenzli / BRZO
Last active July 13, 2026 10:44
Leaky effect handling
;
@dbuenzli
dbuenzli / init.el
Last active April 7, 2026 12:55
neocaml alternative font-lock-mode
;; OCaml stuff
; locate opam's site-lisp
(setq opam-share
(replace-regexp-in-string "\n$" ""
(shell-command-to-string "opam var share 2> /dev/null")))
(add-to-list 'load-path (expand-file-name "emacs/site-lisp" opam-share))
; merlin
(require 'merlin)
@dbuenzli
dbuenzli / opam2json.ml
Last active July 15, 2025 07:19
Encode the opam file format to JSON
(*---------------------------------------------------------------------------
Copyright (c) 2025 The opam programmers. All rights reserved.
SPDX-License-Identifier: LGPL-2.1-only WITH OCaml-LGPL-linking-exception
---------------------------------------------------------------------------*)
(* Usage: opam2json < opam
opam switch export - | opam2json
Compile with:
ocamlfind ocamlopt -linkpkg -package opam-core,opam-format \
opam2json.ml -o opam2json *)
@dbuenzli
dbuenzli / open_issue.ml
Created June 21, 2025 00:17
open gh issue
#!/usr/bin/env ocaml
(*---------------------------------------------------------------------------
Copyright (c) 2025 Daniel C. Bünzli. All rights reserved.
SPDX-License-Identifier: ISC
---------------------------------------------------------------------------*)
#use "topfind"
#require "b0.std"
#require "b0.kit"
@dbuenzli
dbuenzli / .gitignore
Last active June 20, 2025 00:45
Two way string search
_b0
_build
@dbuenzli
dbuenzli / bigbytes_sig.mli
Created June 4, 2025 09:45
Bigbytes signature
(*---------------------------------------------------------------------------
Copyright (c) 2025 The bigbytes programmers. All rights reserved.
SPDX-License-Identifier: ISC
---------------------------------------------------------------------------*)
(** Bigarrays of bytes.
{b Note.} Getter and setters raise [Invalid_argument] on out of
bounds errors. Functions that encode 8-bit or 16-bit integers
represented by [int] values truncate their input their least
@dbuenzli
dbuenzli / ints.mli
Created March 31, 2025 08:47
OCaml integers
(*---------------------------------------------------------------------------
Copyright (c) 2018 Daniel C. Bünzli. All rights reserved.
SPDX-License-Identifier: ISC
---------------------------------------------------------------------------*)
(** Integer types.
[Ints] provides types for specifying sized integer types not
supported by the {!Stdlib}. It also provides bitwise conversion
functions and safe, magnitude preserving, conversions.
@dbuenzli
dbuenzli / .gitignore
Last active February 15, 2025 09:12
Edit distance toy benchmark
_b0
@dbuenzli
dbuenzli / .gitignore
Last active May 11, 2024 14:47
Priority queue docs without dupes
_b0