Skip to content

Instantly share code, notes, and snippets.

View Zerim's full-sized avatar

Brandon Ramirez Zerim

  • San Francisco, CA
View GitHub Profile
@lilactown
lilactown / pledge.re
Created September 28, 2017 03:18
Making it easier to keep our Promises
module type Promise = {
type t 'a;
let then_: ('a => t 'b) => t 'a => t 'b;
let resolve: 'a => t 'a;
let all: array (t 'a) => t (array 'a);
let race: array (t 'a) => t 'a;
let make: (resolve::('a => unit) [@bs] => reject::(exn => unit) [@bs] => unit) => t 'a;
};
module Make (P: Promise) => {