Skip to content

Instantly share code, notes, and snippets.

@hcarty
Created February 21, 2020 15:46
Show Gist options
  • Save hcarty/16d8cecce11b390753dd76d4549a9686 to your computer and use it in GitHub Desktop.
Save hcarty/16d8cecce11b390753dd76d4549a9686 to your computer and use it in GitHub Desktop.
Converting Reason to OCaml
#!/bin/bash
# Use as: find . -name "*.re" -exec ./convert_re.sh {} \;
set -euf -o pipefail
src="$1"
dst="${src%.re}.ml"
echo Converting "$src" to "$dst"
refmt -p binary_reason "$src" | ocamlformat_reason --enable-outside-detected-project --disable-conf-files --impl -o "$dst" -
git add "$dst"
git rm "$src"
#!/bin/bash
# Use as: find . -name "*.rei" -exec ./convert_re.sh {} \;
set -euf -o pipefail
src="$1"
dst="${src%.rei}.mli"
echo Converting "$src" to "$dst"
refmt -p binary_reason "$src" | ocamlformat_reason --enable-outside-detected-project --disable-conf-files --intf -o "$dst" -
git add "$dst"
git rm "$src"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment