Skip to content

Instantly share code, notes, and snippets.

View vmarcosp's full-sized avatar
No action can be virtuous unless it is freely chosen

Marcos Oliveira vmarcosp

No action can be virtuous unless it is freely chosen
View GitHub Profile
We couldn’t find that file to show.
open Belt;
let person = Js.Nullable.return({ "name": "marcos"})->Js.Nullable.toOption;
person
->Option.map(person => person##name)
-> Option.getWithDefault("");
let (>=) = (maybe, func) => maybe->Option.map(func);
let (>?) = (maybe, defaultValue) => maybe->Option.getWithDefault(defaultValue);