Skip to content

Instantly share code, notes, and snippets.

@dysinger
Last active February 7, 2017 02:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dysinger/9e36d3cdc307c4d985c58f96bd690683 to your computer and use it in GitHub Desktop.
Save dysinger/9e36d3cdc307c4d985c58f96bd690683 to your computer and use it in GitHub Desktop.
My OCaml/OPAM notes

OCaml

OCaml Setup

OPAM Bootstrap

One-Time Setup

sudo apt-get install -y build-essential 0install curl aspcud rsync git mercurial bzr
0install add -c opam http://tools.ocaml.org/opam.xml
export PATH=$HOME/bin:$PATH
opam init --comp=4.04.0
eval $(opam config env)

Dev Tools

DEVTOOLS="merlin nosetup ocp-indent utop"

Current Switches

4.04.0 - Default

  • Mirage (Solo5, Unix & Xen)
  • JavaScript
    • js_of_ocaml
    • gen_js_api
  • Misc
    • core
    • async
    • lwt
opam switch -A 4.04.0 4.04.0-$(date +%Y%m%d)
eval $(opam config env)
opam repo add mirage-dev https://github.com/mirage/mirage-dev.git || true
opam install --yes \
     $DEVTOOLS \
     async lwt core \
     mirage depext mirage-solo5 mirage-unix mirage-xen \
     mirage-block-solo5 mirage-block-unix mirage-block-xen \
     mirage-bootvar-solo5 mirage-bootvar-xen \
     mirage-console-solo5 mirage-console-unix mirage-console-xen \
     mirage-net-solo5 mirage-net-unix mirage-net-xen \
     js_of_ocaml gen_js_api

4.02.3 - Reason, Flow & Bucklescript

opam switch -A 4.02.3+buckle-master 4.02.3-$(date +%Y%m%d)
eval $(opam config env)
opam pin add -n reason https://github.com/facebook/reason.git
opam pin add -n flowtype https://github.com/facebook/flow.git
opam install --yes $DEVTOOLS \
     async lwt core \
     reason flowtype
yarn add global bs-platform https://github.com/bloomberg/bucklescript.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment