Learn how to install Unison locally to solve Exercism's exercises on your own machine
The current Unison release is available for Mac OS X, 64-bit Linux, and Windows users! We hope that if you are trying out Unison you'll come talk to us in the Exercism forum or in the Unison Discord. Come ask questions, and report issues you might encounter! We want you to have a welcoming and positive experience when getting started! đ
Unison can be downloaded with homebrew, Nix, or directly via packaged binaries. All of these download options are described in the Installation instructions page of our website. Once you have the UCM installed, head back here!
First install homebrew if you havenât already.
Then from the command line enter these commands:
brew tap unisonweb/unison
brew install unison-language
This will install the Unison codebase manager executable, ucm
. If youâre upgrading from a previous version, just do
brew upgrade unison-language.
Note: if you get prompted for a GitHub username and password at this point, make sure you spelled unisonweb/unison correctly.
Linux and Mac manual install links are provided here under the respective Linux and Mac manual download section.
You'll be running a command in your shell that looks something like this, but the link above will contain the most up-to-date binary:
mkdir unisonlanguage
curl -L https://github.com/unisonweb/unison/releases/download/release_VERSION_NAME/ucm-YOUR_PLATFORM.tar.gz --output unisonlanguage/ucm.tar.gz
tar -xzf unisonlanguage/ucm.tar.gz -C unisonlanguage
./unisonlanguage/ucm
winget install --id Git.Git -e --source winget
ucm.exe
Head to https://github.com/ceedubs/unison-nix/#usage and follow the instructions in the readme there.
Run ucm
to initialize a Unison codebase in $HOME/.unison
. This is where Unison will store function definitions, types, namespaces, and so on. By default, the Unison Codebase Manger (abbreviated the "UCM") will begin downloading the standard library, called base
, which you'll use to write Unison code. It may take a moment! đ°
When you want to write Unison code, you'll issue the ucm
command to start the codebase manager. The UCM will then observe changes to any .u
suffixed file in the directory where it is called from. For example, you might be implementing functions in a file called scratch.u
in a directory called ~/exercism/unison/my-exercise/
. You should cd
into ~/exercism/unison/my-exercise/
and run ucm
. This will ensure that the UCM is watching your scratch.u
file for changes.
If you're ever confused about what directory the ucm
is watching for file changes under, it's printed in the welcome screen upon starting the cli.
đ I'm watching for changes to .u files under /Users/myUser/exercism/unison/my-exercise
You can use any text editor to write your .u
files. Unison has LSP support, so your favorite IDE can help out with things like types on hover and auto-complete. A few popular editors with Unison support are listed below:
Using vim-plug:
vim-plug
if you haven't already.Plug 'unisonweb/unison', { 'branch': 'trunk', 'rtp': 'editor-support/vim' }
:PlugInstall
.For more information run :help unison
from within vim or view the online help doc.
From the console, run:
apm install unisonweb/atom-unison
Install unison-mode
.