Skip to content

Instantly share code, notes, and snippets.

open Ctypes
let libvulkan = Dl.dlopen ~filename:"libvulkan.so" ~flags:Dl.[RTLD_NOW]
let foreign name = Foreign.foreign ~from:libvulkan name
module Printer = Format
open Vk__const
include Builtin_types

Resume

  • Tested: 1483
    • Failure: 1
    • Success: 1482
  • Untested: 221
    • Not installable: 78
    • Missing external dependencies: 74
    • Other issues: 69

Tested

let file = open_in "pkg"
module In = struct
let failure = open_in "failures.in"
let success = open_in "success.in"
end
let (%) f g x = f (g x)
let fmt_open = Format.formatter_of_out_channel % open_out
@Octachron
Octachron / nlist.ml
Last active September 29, 2017 13:59
type 'a succ = private S
type z = private Z
type ('elt,'size) t =
| []: ('elt, z) t
| (::): 'elt * ('elt,'size) t -> ('elt, 'size succ) t
let rec map2: type size. ('elt -> 'elt2 -> 'elt3) -> ('elt,size) t -> ('elt2,size) t -> ('elt3,size) t = fun f x y ->
match x,y with
| a :: q, b :: q' -> (f a b) :: map2 f q q'
module type app = sig
type 'a t
val pure : 'a -> 'a t
val ( <$> ) : ('a -> 'b) t -> 'a t -> 'b t
end
module Unzip(App:app) = struct
open App
let rec f = function
| [] -> pure []
type scalar = float
type z = private Z type 'a s = private S
type _ t =
| Scalar: scalar -> 'any t
| Vec2: {x:float;y:float} -> z s t
| Vec3: {x:float;y:float;z:float} -> z s s t
let (+) (type dim) (x: dim t) (y:dim t) : dim t =
match x, y with
| Scalar a, Scalar b -> Scalar (a +. b)
type scalar = float
type 'a one = [`one of 'a]
type 'a z = [`zero of 'a]
type 'a two = [`two of 'a]
type 'a three = [`three of 'a]
type 'a four = [`three of 'a]
let map2 f x y = Array.init (min (Array.length x) (Array.length y))
(fun n -> f x.(n) y.(n))
module X: sig
type +'a t
val one: [`one of _ ] t
val two: [`two of _ ] t
val match':
[< `one of 'r & 'a | `two of 'r & 'b] t -> 'a -> 'b -> 'r
end = struct
type 'a t = One | Two
let one = One
let two = Two
--- /dev/null
+++ b/contents_motif.svg
@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
+ <path fill="none" d="M0 0h24v24H0V0z"/>
+ <path d="M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"/>
+</svg>
diff --git a/cut.mli b/cut.mli
index e99562c..37d7a56 100755
--- a/cut.mli
let f [%pattern]: [%type_expression] = [%expression]
module type s = [%module_type]
module M = struct
[%%structure_item]
include [%module_expression]
end
module type S = sig [%%signature_item] end
class c: int -> [%class_type] = fun x -> [%class_expression]
class c: object [%%class_type_field] end = object [%%class_field] end