Skip to content

Instantly share code, notes, and snippets.

let all = Js.Promise.all;
let resolve = Js.Promise.resolve;
let reject = Js.Promise.reject;
let andThen =
(p: Js.Promise.t('a), fn: 'a => Js.Promise.t('b)): Js.Promise.t('b) =>
p->Js.Promise.then_(fn, _);
@matthiaskern
matthiaskern / utils.re
Created January 17, 2018 13:51 — forked from girvo/utils.re
A small utility module I use with my ReasonML projects
module Result = {
type result('a, 'b) =
| Ok('a)
| Error('b);
let isOk = (result_) =>
switch result_ {
| Ok(_) => true
| Error(_) => false
};
let isError = (result_) =>