This gist compares the outputs of reason-native's Console.log, Dum, and Inspect's S-expression printer on a test suite that has them print almost every kind of OCaml value.
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
{ pkgs ? import <nixpkgs> {} }: | |
with pkgs; | |
let | |
esy-solve-cudf = stdenv.mkDerivation rec { | |
name = "esy-solve-cudf-${version}"; | |
version = "0.1.10"; | |
src = fetchurl { |
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
(executable | |
(name foo) | |
(preprocess (pps bisect_ppx))) |
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
(executable | |
(name foo) | |
(libraries bigarray)) |
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
(* Note: `Raw signal is not released. I originally had assert false in the cases that use it. *) | |
let write_html_to_channel : Pervasives.out_channel -> Tyxml.Html.doc -> unit = | |
fun channel page -> | |
let ns name = (Markup.Ns.html, name) in | |
let convert_attributes attributes = | |
attributes |> List.map ~f:begin fun attribute -> | |
let value = |
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 from | |
; | |
; type ordinary = | |
; | A | B | C | D | |
; | E of int | F of int | G of int | H of int | |
; | |
; let pattern_match = function | |
; | A -> 0 | |
; | B -> 1 | |
; | C -> 2 |
Compile and run the program below with
ocamlfind opt -linkpkg -package lwt.unix foo.ml && ./a.out
As written with Lwt.pick
, p2
is canceled first, its callback (registered by Lwt.catch
) runs first, and the output is
p2's callback sees p3 pending
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
(* OCaml promise library | |
* http://www.ocsigen.org/lwt | |
* ... | |
*) | |
(* Reading guide | |
... *) |
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
(* OCaml promise library | |
* http://www.ocsigen.org/lwt | |
* ... | |
*) | |
(* Reading guide | |
... *) | |
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
// This function calls the JNI routine DefineClass for each class in the | |
// in-memory class table (see java-classes.h). The class loader parameter passed | |
// to define class is the result of calling ClassLoader.getSystemClassLoader(). | |
jthrowable java_load_classes() | |
{ | |
JNIEnv *environment; | |
jclass class_loader; | |
jmethodID get_system_loader; | |
jobject system_loader; | |
jthrowable exception; |
NewerOlder