Back
Close

Introduction to Reason Compilation

[CG]Nick
2,770 views

6 - Add a Third-Party Dependency

Thanks to our previous step, adding a new dependency is easy.

The OCaml compiler is package manager-agnostic. OPAM is the common one used by the community. Though if you're reading this tutorial, you likely know how to use npm. Good news: we support that as well. This tutorial will focus on the latter.

Usually we'd write a package.json here and let you do npm install to install all the dependencies into ./node_modules; for the sake of simplicity, we're gonna hardcode a dependency (check it out, it's only two files). You get the idea.

We'll also make the corresponding additions to .merlin.

"Run"
print_endline MyDep.secret;
print_endline MyDep2.secret;
print_endline Muffin.secretFlavor;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io
codingame x discord
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants