Skip to content

Instantly share code, notes, and snippets.

View tree-sitter.json
{
"dependencies": {
"ocaml": "4.12.x",
"@opam/tree-sitter": "*"
},
"resolutions": {
"@opam/tree-sitter": {
"source": "github:returntocorp/ocaml-tree-sitter:tree-sitter.opam#bee63d6c4ac7b6d24539f9f2c8cf5ba57ecce91d",
"override": {
"build": "dune build -p tree-sitter",
View weird_stuff_with_let.ml
module X = struct
type record = { field: int }
let value = { field = 1 }
end
(* this works *)
let field =
match X.value with
| {field; _} -> field
(* this fails *)
let { field; _ } = X.value
View elaboration_mrmr.ml
(* this is an elaboration for:
let test (f : ((module S) [@ident M]) -> 'a M.t) =
let x : (module M) = M in
f x;;
which is a variant of the example at https://github.com/ocaml/ocaml/pull/9187#issuecomment-778476951
The goal here is to show that is posssible to describe the same code as above using FCM
View example_infinite_recursive_md_type.ml
type ('a, 'b) eq = Eq : ('a, 'a) eq
module type X = sig
module type T'
module type T = sig
module T : T'
end
type a
View elaboration_hkt.re
[@ocaml.ppx.context
{
tool_name: "ppxlib_driver",
include_dirs: [],
load_path: [
"",
"/home/eduardo/.esy/3_________________________________________________________________/i/ocaml-4.10.2000-76cdf1b9/lib/ocaml",
],
open_modules: [],
for_package: None,
View encode_gadt.ml
type _ ty = Int_t : int ty | List_t : 'a ty -> 'a list ty
type ex_ty = Ex_ty : _ ty -> ex_ty
type ex_value = Ex_value : 'a ty * 'a -> ex_value
let rec encode_ty : type a. a ty -> string = function
| Int_t -> "Int_t"
| List_t ty -> Format.sprintf "List_t(%s)" (encode_ty ty)
View Parallel_select_engine.re
open Lwt_engine;
[@ocaml.warning "-3"];
module Lwt_sequence = Lwt_sequence;
[@ocaml.warning "+3"];
module Fd_map =
Map.Make({
type t = Unix.file_descr;
let compare = compare;
View comparision.md

classic #80b73273ea57389062303c3325a67eaf9298800c

Estimated testing time 30s (3 benchmarks x 10s). Change using '-quota'.
┌───────────────────┬────────────┬──────────┬────────────┬────────────┬────────────┐
│ Name              │   Time/Run │  mWd/Run │   mjWd/Run │   Prom/Run │ Percentage │
├───────────────────┼────────────┼──────────┼────────────┼────────────┼────────────┤
│ FA1.2_Approve     │    11.85us │   6.49kw │      8.06w │      8.06w │      1.03% │
│ FA1.2_Transfer    │    18.47us │  10.41kw │     11.01w │     11.01w │      1.60% │
│ Dexter_xtzToToken │ 1_151.07us │ 619.98kw │ 11_152.26w │ 11_152.26w │    100.00% │
View serialize.typed_ir.ml
open Alpha_context
open Script_typed_ir
let rec serialize_stack_prefix_preservation_witness :
type b a b_s b_a.
(b, a, b_s, b_a) stack_prefix_preservation_witness -> string = function
| Prefix next ->
Format.sprintf
"(Prefix (%s))"
(serialize_stack_prefix_preservation_witness next)
View multicore.json
{
"name": "minecraft-bizarre-adventures",
"esy": {
"build": "dune build -p minecraft-ml",
"install": "esy-installer minecraft-ml.install"
},
"scripts": {
"start": "esy x minecraft-ml"
},
"dependencies": {