Skip to content

Instantly share code, notes, and snippets.

View kayceesrk's full-sized avatar

KC Sivaramakrishnan kayceesrk

View GitHub Profile
@kayceesrk
kayceesrk / move.diff
Created April 10, 2016 10:58
move.diff
diff --git a/boot/ocamlc b/boot/ocamlc
index 6c7ba14..c063309 100755
Binary files a/boot/ocamlc and b/boot/ocamlc differ
diff --git a/boot/ocamldep b/boot/ocamldep
index 29ad003..26935c5 100755
Binary files a/boot/ocamldep and b/boot/ocamldep differ
diff --git a/boot/ocamllex b/boot/ocamllex
index 2e40046..5da3c7e 100755
Binary files a/boot/ocamllex and b/boot/ocamllex differ
diff --git a/byterun/addrmap.c b/byterun/addrmap.c
FROM ocaml/opam:raspbian-8_ocaml-4.02.3
RUN opam remote add main https://opam.ocaml.org
RUN opam pin add -y merlin https://github.com/the-lambda-church/merlin.git#reason-0.0.1
RUN opam pin add -y merlin_extend https://github.com/let-def/merlin-extend.git#reason-0.0.1
RUN opam pin add -y reason https://github.com/facebook/reason.git#0.0.6
(* Fun with behavioral types. Inspired by https://hal.archives-ouvertes.fr/hal-01216310 *)
type ('a,'b) test_result = True of 'a | False of 'b
module type Ref =
sig
type ('a, 'b) ref constraint 'b = [>]
(* 'b is the behavioural type variable *)
val ref : 'a -> ('a, 'b) ref
(* Fun with behavioral types. Inspired by https://hal.archives-ouvertes.fr/hal-01216310 *)
module type Ref =
sig
type ('a, 'b) ref constraint 'b = [>]
(* 'b is the behavioural type variable *)
val ref : 'a -> ('a, 'b) ref
val read : ('a, [`Read of 'b]) ref -> 'a * ('a, 'b) ref
(* Require `Read capability. 'b is the continuation's behavior. *)
(* Fun with behavioral types. Inspired by https://hal.archives-ouvertes.fr/hal-01216310 *)
exception LinearityViolation
module type Ref =
sig
type ('a, 'b) ref constraint 'b = [>]
(* 'b is the behavioural type variable *)
val ref : 'a -> ('a, 'b) ref

p2p key-value store over datakit

Data Model

Key -> Path
Value -> Json

The value is possibly JSON automatically generated for OCaml type definitions using ppx_deriving_yojson library. Merge function must be explicitly specified:

module Main where
import Debug.Trace
import Control.Exception.Base
import Control.Monad
import Control.Concurrent
import Control.Concurrent.STM
type MyChan a = (TVar (Maybe a), TVar Bool)
newMyChan :: IO (MyChan a)
#!/bin/sh
sort -n | awk '
BEGIN {
c = 0;
sum = 0;
}
$1 ~ /^[0-9]*(\.[0-9]*)?$/ {
a[c++] = $1;
sum += $1;
}
## Docker file for OCaml with GDB support
#
# Build
# -----
# $ mkdir monda-docker
# $ cp <this_file> monda-docker/
# $ docker build --force-rm=true -t monda .
# ..takes a while..
#
# Run
## Docker file for OCaml with GDB support
#
# Build
# -----
# $ mkdir monda-docker
# $ cp <this_file> monda-docker/
# $ docker build --force-rm=true -t monda .
# ..takes a while..
#
# Run