Skip to content

Commit 6a6173d

Browse files
Deployed 2c5480f to v6.0.1
1 parent 0834a06 commit 6a6173d

33 files changed

Lines changed: 28039 additions & 69 deletions

v6.0.1/404.html

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

v6.0.1/advanced-js-interop.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
<meta name="generator" content="VitePress v1.0.0-rc.42">
99
<link rel="preload stylesheet" href="/v6.0.1/assets/style.DZd8f7-W.css" as="style">
1010

11-
<script type="module" src="/v6.0.1/assets/app.f4TOus-T.js"></script>
11+
<script type="module" src="/v6.0.1/assets/app.mgd5vH0R.js"></script>
1212
<link rel="preload" href="/v6.0.1/assets/inter-roman-latin.bvIUbFQP.woff2" as="font" type="font/woff2" crossorigin="">
1313
<link rel="modulepreload" href="/v6.0.1/assets/chunks/framework.0V7JO_nO.js">
14-
<link rel="modulepreload" href="/v6.0.1/assets/chunks/theme.n9nWCNQn.js">
14+
<link rel="modulepreload" href="/v6.0.1/assets/chunks/theme.bAEW1b7M.js">
1515
<link rel="modulepreload" href="/v6.0.1/assets/advanced-js-interop.md._Zk0unb_.lean.js">
1616
<script>document.addEventListener("DOMContentLoaded",()=>{const e=["reasonml","ocaml"],n="syntax__";let t;((a=e[0])=>{document.body.classList.remove(`${n}${t}`),document.body.classList.add(`${n}${a}`),t=a,localStorage.setItem("syntax",t)})(localStorage.getItem("syntax",t)||e[0])});</script>
1717
<script id="check-dark-mode">(()=>{const e=localStorage.getItem("vitepress-theme-appearance")||"auto",a=window.matchMedia("(prefers-color-scheme: dark)").matches;(!e||e==="auto"?a:e==="dark")&&document.documentElement.classList.add("dark")})();</script>
@@ -223,7 +223,7 @@
223223
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
224224
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> print ,</span></span>
225225
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>So one can use either <code>require</code> or <code>import</code> (depending on the module system of choice) to import the <code>print</code> value in a JavaScript file.</p><h3 id="default-es6-values" tabindex="-1">Default ES6 values <a class="header-anchor" href="#default-es6-values" aria-label="Permalink to &quot;Default ES6 values&quot;"></a></h3><p>One special case occur when working with JavaScript imports in ES6 modules that look like this:</p><div class="language-js vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">js</span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ten </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &#39;numbers.js&#39;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span></code></pre></div><p>This import expects <code>numbers.js</code> to have a default export, like:</p><div class="language-js vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">js</span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ten </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 10</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span></code></pre></div><p>To emulate this kind of exports from Melange, one just needs to define a <code>default</code> value.</p><p>For example, in a file named <code class="text-ocaml">numbers.ml</code><code class="text-reasonml">numbers.re</code>:</p><div class="language-ocaml vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ocaml</span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">let</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> default</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 10</span></span></code></pre></div><div class="language-reasonml vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">reasonml</span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">let</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> default</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 10</span><span style="--shiki-light:#B31D28;--shiki-dark:#FDAEB7;">;</span></span></code></pre></div><p>That way, Melange will set the value on the <code>default</code> export so it can be consumed as default import on the JavaScript side.</p></div></div></main><footer class="VPDocFooter" data-v-39a288b8 data-v-48f9bb55><!--[--><!--]--><div class="edit-info" data-v-48f9bb55><div class="edit-link" data-v-48f9bb55><a class="VPLink link vp-external-link-icon no-icon edit-link-button" href="https://github.com/melange-re/melange-re.github.io/edit/master/docs/advanced-js-interop.md" target="_blank" rel="noreferrer" data-v-48f9bb55><!--[--><svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 24 24" class="edit-link-icon" aria-label="edit icon" data-v-48f9bb55><path d="M18,23H4c-1.7,0-3-1.3-3-3V6c0-1.7,1.3-3,3-3h7c0.6,0,1,0.4,1,1s-0.4,1-1,1H4C3.4,5,3,5.4,3,6v14c0,0.6,0.4,1,1,1h14c0.6,0,1-0.4,1-1v-7c0-0.6,0.4-1,1-1s1,0.4,1,1v7C21,21.7,19.7,23,18,23z"></path><path d="M8,17c-0.3,0-0.5-0.1-0.7-0.3C7,16.5,6.9,16.1,7,15.8l1-4c0-0.2,0.1-0.3,0.3-0.5l9.5-9.5c1.2-1.2,3.2-1.2,4.4,0c1.2,1.2,1.2,3.2,0,4.4l-9.5,9.5c-0.1,0.1-0.3,0.2-0.5,0.3l-4,1C8.2,17,8.1,17,8,17zM9.9,12.5l-0.5,2.1l2.1-0.5l9.3-9.3c0.4-0.4,0.4-1.1,0-1.6c-0.4-0.4-1.2-0.4-1.6,0l0,0L9.9,12.5z M18.5,2.5L18.5,2.5L18.5,2.5z"></path></svg> Edit this page<!--]--></a></div><!----></div><nav class="prev-next" data-v-48f9bb55><div class="pager" data-v-48f9bb55><a class="VPLink link pager-link prev" href="/v6.0.1/working-with-js-objects-and-values.html" data-v-48f9bb55><!--[--><span class="desc" data-v-48f9bb55>Previous page</span><span class="title" data-v-48f9bb55>Working with JavaScript objects and values</span><!--]--></a></div><div class="pager" data-v-48f9bb55><a class="VPLink link pager-link next" href="/v6.0.1/bindings-cookbook.html" data-v-48f9bb55><!--[--><span class="desc" data-v-48f9bb55>Next page</span><span class="title" data-v-48f9bb55>Bindings cookbook</span><!--]--></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><!----><!--[--><!--]--></div></div>
226-
<script>window.__VP_HASH_MAP__=JSON.parse("{\"communicate-with-javascript.md\":\"4El4v6O1\",\"build-system.md\":\"8cvjjiXr\",\"api.md\":\"xjJ98wNN\",\"attributes-and-extension-nodes.md\":\"NqGQoyOy\",\"roadmap.md\":\"HOtAwflR\",\"new-to-ocaml.md\":\"bRyU6jQg\",\"what-is-melange.md\":\"cvw-99wt\",\"resources.md\":\"-qvhP0bX\",\"community.md\":\"FJ13iNUf\",\"package-management.md\":\"Pb4-LSu5\",\"language-concepts.md\":\"wOkhLcMT\",\"melange-for-x-developers.md\":\"8K-DHt0b\",\"how-to-guides.md\":\"-uRNm836\",\"rationale.md\":\"M1aWvVtm\",\"syntaxes.md\":\"ifGWtnlC\",\"index.md\":\"TsGc5bsy\",\"data-types-and-runtime-rep.md\":\"bDqxTMZk\",\"bindings-cookbook.md\":\"Fi2JWCjF\",\"working-with-js-objects-and-values.md\":\"3gxxFXq-\",\"advanced-js-interop.md\":\"_Zk0unb_\",\"getting-started.md\":\"difGRO8d\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"en-US\",\"dir\":\"ltr\",\"title\":\"Melange Documentation Site\",\"description\":\"The official documentation site for Melange, a compiler from OCaml to JavaScript. Explore the features and resources for functional programming with Melange, including the standard libraries APIs, the playground, and extensive documentation about bindings, build system, and the opam package manager.\",\"base\":\"/v6.0.1/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"outline\":{\"level\":[2,3]},\"search\":{\"provider\":\"local\"},\"editLink\":{\"pattern\":\"https://github.com/melange-re/melange-re.github.io/edit/master/docs/:path\"},\"nav\":[{\"text\":\"Learn\",\"link\":\"/what-is-melange\"},{\"text\":\"API\",\"link\":\"/api\"},{\"text\":\"Playground\",\"link\":\"/playground/\",\"target\":\"_self\"},{\"text\":\"Book\",\"link\":\"https://react-book.melange.re\"},{\"text\":\"Blog\",\"link\":\"https://melange.re/blog\"},{\"text\":\"v6.0.1\",\"items\":[{\"text\":\"v5.0.0\",\"link\":\"https://melange.re/v5.0.0/\"},{\"text\":\"v4.0.0\",\"link\":\"https://melange.re/v4.0.0/\"},{\"text\":\"v3.0.0\",\"link\":\"https://melange.re/v3.0.0/\"},{\"text\":\"v2.2.0\",\"link\":\"https://melange.re/v2.2.0/\"},{\"text\":\"v2.1.0\",\"link\":\"https://melange.re/v2.1.0/\"},{\"text\":\"v2.0.0\",\"link\":\"https://melange.re/v2.0.0/\"},{\"text\":\"v1.0.0\",\"link\":\"https://melange.re/v1.0.0/\"},{\"text\":\"unstable\",\"link\":\"https://melange.re/unstable/\"}]}],\"sidebar\":[{\"text\":\"Intro\",\"items\":[{\"text\":\"What is Melange\",\"link\":\"/what-is-melange\"},{\"text\":\"Rationale\",\"link\":\"/rationale\"},{\"text\":\"Supported syntaxes\",\"link\":\"/syntaxes\"},{\"text\":\"Getting Started\",\"link\":\"/getting-started\"}]},{\"text\":\"Learn\",\"items\":[{\"text\":\"New to OCaml?\",\"link\":\"/new-to-ocaml\"},{\"text\":\"Package Management\",\"link\":\"/package-management\"},{\"text\":\"Build System\",\"link\":\"/build-system\"},{\"text\":\"How-to Guides\",\"link\":\"/how-to-guides\"},{\"text\":\"Melange for X Developers\",\"link\":\"/melange-for-x-developers\"}]},{\"text\":\"Communicate with JavaScript\",\"items\":[{\"text\":\"Overview\",\"link\":\"/communicate-with-javascript\"},{\"text\":\"Language concepts\",\"link\":\"/language-concepts\"},{\"text\":\"Data types and runtime representation\",\"link\":\"/data-types-and-runtime-rep\"},{\"text\":\"Melange attributes and extension nodes\",\"link\":\"/attributes-and-extension-nodes\"},{\"text\":\"Working with JavaScript objects and values\",\"link\":\"/working-with-js-objects-and-values\"},{\"text\":\"Advanced JavaScript interoperability\",\"link\":\"/advanced-js-interop\"},{\"text\":\"Bindings cookbook\",\"link\":\"/bindings-cookbook\"}]},{\"text\":\"Reference\",\"items\":[{\"text\":\"API\",\"link\":\"/api\"}]},{\"text\":\"Try\",\"items\":[{\"text\":\"Playground\",\"link\":\"/playground/\",\"target\":\"_self\"}]},{\"text\":\"About\",\"items\":[{\"text\":\"Community\",\"link\":\"/community\"},{\"text\":\"Resources\",\"link\":\"/resources\"},{\"text\":\"Roadmap\",\"link\":\"/roadmap\"}]}],\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/melange-re/melange\"}]},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
226+
<script>window.__VP_HASH_MAP__=JSON.parse("{\"api.md\":\"xjJ98wNN\",\"communicate-with-javascript.md\":\"4El4v6O1\",\"build-system.md\":\"8cvjjiXr\",\"index.md\":\"TsGc5bsy\",\"getting-started.md\":\"difGRO8d\",\"resources.md\":\"-qvhP0bX\",\"package-management.md\":\"Pb4-LSu5\",\"data-types-and-runtime-rep.md\":\"bDqxTMZk\",\"roadmap.md\":\"HOtAwflR\",\"bindings-cookbook.md\":\"Fi2JWCjF\",\"melange-for-x-developers.md\":\"8K-DHt0b\",\"what-is-melange.md\":\"cvw-99wt\",\"syntaxes.md\":\"ifGWtnlC\",\"advanced-js-interop.md\":\"_Zk0unb_\",\"community.md\":\"FJ13iNUf\",\"new-to-ocaml.md\":\"bRyU6jQg\",\"attributes-and-extension-nodes.md\":\"NqGQoyOy\",\"rationale.md\":\"M1aWvVtm\",\"how-to-guides.md\":\"-uRNm836\",\"language-concepts.md\":\"wOkhLcMT\",\"working-with-js-objects-and-values.md\":\"3gxxFXq-\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"en-US\",\"dir\":\"ltr\",\"title\":\"Melange Documentation Site\",\"description\":\"The official documentation site for Melange, a compiler from OCaml to JavaScript. Explore the features and resources for functional programming with Melange, including the standard libraries APIs, the playground, and extensive documentation about bindings, build system, and the opam package manager.\",\"base\":\"/v6.0.1/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"outline\":{\"level\":[2,3]},\"search\":{\"provider\":\"local\"},\"editLink\":{\"pattern\":\"https://github.com/melange-re/melange-re.github.io/edit/master/docs/:path\"},\"nav\":[{\"text\":\"Learn\",\"link\":\"/what-is-melange\"},{\"text\":\"API\",\"link\":\"/api\"},{\"text\":\"Playground\",\"link\":\"/playground/\",\"target\":\"_self\"},{\"text\":\"Book\",\"link\":\"https://react-book.melange.re\"},{\"text\":\"Blog\",\"link\":\"https://melange.re/blog\"},{\"text\":\"v6.0.1\",\"items\":[{\"text\":\"v5.0.0\",\"link\":\"https://melange.re/v5.0.0/\"},{\"text\":\"v4.0.0\",\"link\":\"https://melange.re/v4.0.0/\"},{\"text\":\"v3.0.0\",\"link\":\"https://melange.re/v3.0.0/\"},{\"text\":\"v2.2.0\",\"link\":\"https://melange.re/v2.2.0/\"},{\"text\":\"v2.1.0\",\"link\":\"https://melange.re/v2.1.0/\"},{\"text\":\"v2.0.0\",\"link\":\"https://melange.re/v2.0.0/\"},{\"text\":\"v1.0.0\",\"link\":\"https://melange.re/v1.0.0/\"},{\"text\":\"unstable\",\"link\":\"https://melange.re/unstable/\"}]}],\"sidebar\":[{\"text\":\"Intro\",\"items\":[{\"text\":\"What is Melange\",\"link\":\"/what-is-melange\"},{\"text\":\"Rationale\",\"link\":\"/rationale\"},{\"text\":\"Supported syntaxes\",\"link\":\"/syntaxes\"},{\"text\":\"Getting Started\",\"link\":\"/getting-started\"}]},{\"text\":\"Learn\",\"items\":[{\"text\":\"New to OCaml?\",\"link\":\"/new-to-ocaml\"},{\"text\":\"Package Management\",\"link\":\"/package-management\"},{\"text\":\"Build System\",\"link\":\"/build-system\"},{\"text\":\"How-to Guides\",\"link\":\"/how-to-guides\"},{\"text\":\"Melange for X Developers\",\"link\":\"/melange-for-x-developers\"}]},{\"text\":\"Communicate with JavaScript\",\"items\":[{\"text\":\"Overview\",\"link\":\"/communicate-with-javascript\"},{\"text\":\"Language concepts\",\"link\":\"/language-concepts\"},{\"text\":\"Data types and runtime representation\",\"link\":\"/data-types-and-runtime-rep\"},{\"text\":\"Melange attributes and extension nodes\",\"link\":\"/attributes-and-extension-nodes\"},{\"text\":\"Working with JavaScript objects and values\",\"link\":\"/working-with-js-objects-and-values\"},{\"text\":\"Advanced JavaScript interoperability\",\"link\":\"/advanced-js-interop\"},{\"text\":\"Bindings cookbook\",\"link\":\"/bindings-cookbook\"}]},{\"text\":\"Reference\",\"items\":[{\"text\":\"API\",\"link\":\"/api\"}]},{\"text\":\"Try\",\"items\":[{\"text\":\"Playground\",\"link\":\"/playground/\",\"target\":\"_self\"}]},{\"text\":\"About\",\"items\":[{\"text\":\"Community\",\"link\":\"/community\"},{\"text\":\"Resources\",\"link\":\"/resources\"},{\"text\":\"Roadmap\",\"link\":\"/roadmap\"}]}],\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/melange-re/melange\"}]},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
227227

228228
</body>
229229
</html>

v6.0.1/api.html

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

v6.0.1/api/ml/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
<div class="by-name">
1212
<h2>OCaml package documentation</h2>
1313
<ol>
14-
<li><a href="melange/index.html">melange</a> <span class="version">6.0.1-54</span></li>
14+
<li><a href="melange/index.html">melange</a></li>
15+
<li><a href="melange-playground/index.html">melange-playground</a></li>
1516
</ol>
1617
</div>
1718
</main>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<!DOCTYPE html>
2+
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>index (melange-playground.index)</title><meta charset="utf-8"/><link rel="stylesheet" href="../odoc.support/odoc.css"/><meta name="generator" content="odoc 3.1.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../odoc.support/highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a><a href="../index.html">Index</a> &#x00BB; melange-playground</nav><header class="odoc-preamble"><h1 id="melange-playground-index"><a href="#melange-playground-index" class="anchor"></a>melange-playground index</h1></header><div class="odoc-content"></div></body></html>

v6.0.1/api/re/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
<div class="by-name">
1212
<h2>OCaml package documentation</h2>
1313
<ol>
14-
<li><a href="melange/index.html">melange</a> <span class="version">6.0.1-54</span></li>
14+
<li><a href="melange/index.html">melange</a></li>
15+
<li><a href="melange-playground/index.html">melange-playground</a></li>
1516
</ol>
1617
</div>
1718
</main>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<!DOCTYPE html>
2+
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>index (melange-playground.index)</title><meta charset="utf-8"/><link rel="stylesheet" href="../odoc.support/odoc.css"/><meta name="generator" content="odoc 3.1.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../odoc.support/highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a><a href="../index.html">Index</a> &#x00BB; melange-playground</nav><header class="odoc-preamble"><h1 id="melange-playground-index"><a href="#melange-playground-index" class="anchor"></a>melange-playground index</h1></header><div class="odoc-content"></div></body></html>

v6.0.1/assets/app.mgd5vH0R.js

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

v6.0.1/assets/chunks/@localSearchIndexroot.lsdBdvan.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)