Skip to content

Instantly share code, notes, and snippets.

(*
OCaml translation of the ideas explained in http://fumieval.hatenablog.com/entry/2014/09/22/144401
To emulate the higher kinded polymorphism, the technique used explained in https://ocamllabs.github.io/higher/lightweight-higher-kinded-polymorphism.pdf
*)
module StateMonad = struct
type ('s, 'a) m = 's -> 's * 'a
(* OCaml version
compile with:
ocamlopt str.cmxa -o classifyDigits classifyDigits.ml
*)
(*
// This F# dojo is directly inspired by the
// Digit Recognizer competition from Kaggle.com:
// http://www.kaggle.com/c/digit-recognizer
// The datasets below are simply shorter versions of
let () =
prerr_endline @@ GMain.Main.init ();
let window = GWindow.window ~title: "liv" ~allow_shrink: true ~allow_grow: true () in
window#show ();
window#event#add [`SCROLL];
ignore @@ window#event#connect#scroll ~callback:(fun ev ->
Printf.eprintf "at +%.0f+%.0f %s\n%!"
(GdkEvent.Scroll.x ev)
(GdkEvent.Scroll.y ev)