Skip to content

Instantly share code, notes, and snippets.

@Lupus
Created December 2, 2017 18:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Lupus/dff17699568652495fce6b07969eb96b to your computer and use it in GitHub Desktop.
Save Lupus/dff17699568652495fce6b07969eb96b to your computer and use it in GitHub Desktop.
// Generated by BUCKLESCRIPT VERSION 1.9.2, PLEASE EDIT WITH CARE
'use strict';
var Caml_missing_polyfill = require("stdlib/caml_missing_polyfill");
function foo (x) {
if (x == 0) return null;
else if (x == 1) return 0;
return "bar";
}
;
Caml_missing_polyfill.not_implemented(" not implemented by bucklescript yet\n");
/* Not a pure module */
type t =
| Int(int)
| String(string);
type returnType = Js.nullable(t);
[%%bs.raw{|
function foo (x) {
if (x == 0) return null;
else if (x == 1) return 0;
return "bar";
}
|}];
external foo: int => returnType = "";
foo(0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment