Skip to content

Instantly share code, notes, and snippets.

View arnarthor's full-sized avatar

Arnar Þór Sveinsson arnarthor

View GitHub Profile
let component = ReasonReact.statelessComponent("IconVideo");
let make = (~className, ~shapeClassName, _children) => {
...component,
render: (_) =>
<svg className viewBox="0 0 18 21" version="1.1" xmlns="http://www.w3.org/2000/svg">
<g stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
<g className=shapeClassName transform="translate(-454.000000, -130.000000)">
<g transform="translate(362.000000, 125.000000)">
<path
var amplitude = require('amplitude-js');
var apiKey;
exports.init = function init(key) {
apiKey = key;
amplitude.getInstance(apiKey).init(apiKey);
};
exports.client = amplitude;
exports.logEventWithUserProperties = function logEventWithUserProperties(

Install opam brew install opam

Switch to correct compiler (using Bucklescript 5.x would be OCaml 4.02.3) opam switch create 4.02.3

Using merlin with Reason globally installed via opam opam install reason opam install merlin

open Belt;
let randomlyFailedPromise = () => {
let random = Js.Math.random();
Js.Promise.make((~resolve, ~reject as _) =>
resolve(.
if (random > 0.5) {
Result.Error(`NumberToHigh);
} else {
Result.Ok(random);

Reason

I have heard a lot of complaints about lack of editor integration or flaky editor tooling in the Reason community. At my previous job we had ~3000 modules and ~80k LOC. I'll admit that we were not very vigilant with .rei files or keeping our inter module dependencies really clean so this slowed both bsb and especially reason-language-server down a lot.

In fact so much that people couldn't use reason-language-server anymore on 15" MacBook Pros.

I myself have always used a Merlin based setup since I joined the Reason eco system before reason-language-server, and in our project my setup had never failed. Therefor I went on a quest of setting up 3 of the major editors (Emacs, Vim and VSCode) and documenting how to get them working

Keybase proof

I hereby claim:

  • I am arnarthor on github.
  • I am arnarthor (https://keybase.io/arnarthor) on keybase.
  • I have a public key ASAGye_bfg6S-1ulv7Nu2sxysARpVbopzbM7wN1moKY0RQo

To claim this, I am signing this object: