Skip to content

Instantly share code, notes, and snippets.

View Drup's full-sized avatar

Gabriel Radanne Drup

View GitHub Profile
@Drup
Drup / foo.html
Last active August 29, 2015 14:00
test weak + js_of_ocaml
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head></head>
<body>
<script src="foo.js"></script>
</body>
</html>
@Drup
Drup / lilis.bench
Last active August 29, 2015 14:01
Lilis stream benchmark
With lilis@0ff6f65
--- Lsystem Von_koch for 7 iterations ---
Rate Stream+ LazyList+ CFStream+ Enum+ Gen+ Core+ Seq+ Sequence+
Stream+ 3.34+-0.02/s -- -37% -73% -88% -91% -92% -93% -95%
LazyList+ 5.32+-0.06/s 59% -- -58% -81% -85% -87% -89% -92%
CFStream+ 12.6+- 0.0/s 276% 136% -- -56% -65% -69% -74% -80%
Enum+ 28.7+- 0.0/s 760% 440% 128% -- -19% -29% -40% -54%
Gen+ 35.4+- 0.0/s 960% 566% 182% 23% -- -12% -26% -44%
Core+ 40.4+- 0.1/s 1108% 659% 221% 41% 14% -- -16% -36%
@Drup
Drup / point.ml
Created March 28, 2015 20:33
functional points
type vector = { x : float ; y : float }
let add_pair a b =
{ x = a.x +. b.y ; y = a.x +. b.y }
module Point = struct
class t ~pos ~vel = object (self)
val pos = pos
val vel = vel
@Drup
Drup / eqtype.ml
Last active August 29, 2015 14:25
Something something eqtype
type (_,_) eq = Refl : ('a,'a) eq
module type EqTag = sig
type 'a t
val create : unit -> 'a t
val equal : 'a t -> 'b t -> ('a, 'b) eq option
end
module M : EqTag = struct
@Drup
Drup / mirage.utfart
Created September 12, 2015 20:17
mirage socket stack, in utf8 art
bootvar ◀╴╴ main
╵ ╵
╵ ╵
▼ ▼
argv_unix ◀━━ If target f1 ─┐
│ │ │
│ │ │
@Drup
Drup / Configure help page for mirage-www
Created September 14, 2015 14:14
Help pages for mirage-www with functoria.
MIRAGE-CONFIGURE(1) Mirage Manual MIRAGE-CONFIGURE(1)
NAME
mirage-configure - Configure a mirage application.
SYNOPSIS
mirage configure [OPTION]...
@Drup
Drup / gist:792aa5cc5e271e3f04e1
Created November 9, 2015 16:12
failure Z3 config python2
+ python2 "scripts/mk_make.py" "--ml" "--prefix" "/home/gabriel/.opam/termite" (CWD=/home/gabriel/.opam/termite/build/Z3.dev)
- opt = --ml, arg =
- opt = --prefix, arg = /home/gabriel/.opam/termite
- New component: 'util'
- New component: 'polynomial'
- New component: 'sat'
- New component: 'nlsat'
- New component: 'hilbert'
- New component: 'simplex'
- New component: 'interval'
@Drup
Drup / gen_apply.ml
Last active January 11, 2016 21:51
Metaocaml + Gadt function manipulation.
(** unary number as Gadt list, with two potential return types *)
type (_, _, _, _) num =
| Z : ('ret, 'ret, 'ret2, 'ret2) num
| C : ('a, 'ret, 'a2, 'ret2) num -> ('b code -> 'a, 'ret, 'b -> 'a2, 'ret2) num
(** Postpend Gadt list *)
type (_,_) tuple =
| Zero : ('ret, 'ret) tuple
| Cons : 'b * ('a, 'b -> 'ret) tuple -> ('a, 'ret) tuple
@Drup
Drup / shuffle.ml
Created January 16, 2016 17:35
Test shuffling for Sequence.shuffle_buffer
open Sequence.Infix
let px = 1000
let l = px/5
let buf_l = l/2
let s = 0 -- (l-1)
let m = Array.make_matrix l l 0
let fill_array =
@Drup
Drup / difflist.ml
Last active June 12, 2023 17:26
Difference lists and Miniformat
type ('ty,'v) t =
| Nil : ('v, 'v) t
| Cons : 'a * ('ty, 'v) t -> ('a -> 'ty, 'v) t
let cons x l = Cons (x,l)
let plus1 l = Cons ((),l)
let one x = Cons (x,Nil)