Skip to content

Instantly share code, notes, and snippets.

View kayceesrk's full-sized avatar

KC Sivaramakrishnan kayceesrk

View GitHub Profile
(* 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
(* 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 *)
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
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
@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
module type Applicative = sig
type 'a t
val pure : 'a -> 'a t
val (<*>) : ('a -> 'b) t -> 'a t -> 'b t
end
module type Promise = sig
include Applicative
val fork : (unit -> 'a) -> 'a t
val get : 'a t -> ('a, exn) result
module type Arrow =
sig
type ('a,'b) t
val arr : ('a -> 'b) -> ('a, 'b) t
val (>>>) : ('a,'b) t -> ('b,'c) t -> ('a,'c) t
val first : ('a,'b) t -> ('a * 'c, 'b * 'c) t
end
module type Arrow_choice =
sig
module type Arrow =
sig
type ('a,'b) t
val arr : ('a -> 'b) -> ('a, 'b) t
val (>>>) : ('a,'b) t -> ('b,'c) t -> ('a,'c) t
val first : ('a,'b) t -> ('a * 'c, 'b * 'c) t
end
module type Arrow_choice =
sig
module type Arrow =
sig
type ('a,'b) t
val arr : ('a -> 'b) -> ('a, 'b) t
val (>>>) : ('a,'b) t -> ('b,'c) t -> ('a,'c) t
val first : ('a,'b) t -> ('a * 'c, 'b * 'c) t
end
module type Arrow_choice =
sig
@kayceesrk
kayceesrk / rand.rkt
Created January 19, 2016 13:01
Redex amb
#lang racket
(require redex)
(define-language L
(e (e e)
(λ (x t) e)
x
(amb e ...)
number
(+ e ...)