Home

Awesome

learn-ocaml.el

Test MELPA

Summary

learn-ocaml.el is an Emacs frontend for students using learn-ocaml.

Dependencies

Emacs

(version 25.1 or later)

learn-ocaml-client

Note: beyond learn-ocaml-client, you may want to install a comprehensive OCaml/Emacs environment (with Tuareg, Merlin, Company): for details, see https://github.com/erikmd/tapfa-init.el (in French)

Installation (using MELPA)

MELPA is a repository of Emacs packages. Skip this step if you already use MELPA. Otherwise, add the following to your .emacs and restart Emacs:

(require 'package)
;; (setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3") ; see remark below
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)

Remark: If you have Emacs 26.1 (which is precisely the packaged version in Debian 10), you may get the error message Failed to download 'melpa' archive during the package refresh step. This is a know bug (debbug #34341) which has been fixed in Emacs 26.3 and 27.1, while a simple workaround consists in uncommenting the line (setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3") above in your .emacs.

Then, run <kbd>M-x package-refresh-contents RET</kbd> followed by <kbd>M-x package-install RET learn-ocaml RET</kbd> to install and byte-compile learn-ocaml.

Usage

Enable the minor mode in any buffer:

<kbd>M-x learn-ocaml-mode RET</kbd>

Follow the instructions regarding the server URL and token (which will automatically be stored in ~/.config/learnocaml/client.json).

Open the LearnOCaml menu or directly start an exercise from the *learn-ocaml-exercise-list* buffer.

Then, the learn-ocaml-mode will automatically be activated when opening .ml buffers using tuareg-mode and the following keybindings will be available:

Known limitations

Feedback

Bug reports and suggestions are very welcome: feel free to open a new issue or PR.

Developer docs

Authors and Acknowledgments

learn-ocaml.el has been developed in University Toulouse III by Erik Martin-Dorel, Manuel Cabarcos Baulina, and Louis Ayroles, thanks to the support of the OCaml Software Foundation.

License

learn-ocaml.el is a free software distributed under the MIT License.