Three-minute quickstart guide
This short guide will have you downloading and installing Unison and running your first program. There isn't much exposition here and the focus is on getting you up and running as quickly as possible. 🏎
More in-depth guides follow this one.
If you have any trouble with the process, or have ideas about how to improve this document, come talk to us in the #alphatesting Slack channel! This document is also on GitHub.
Step 1: Install Unison
When Unison is further along and ready for more general availability we'll just include those instructions here. For now, given the many rough edges that exist, we are really hoping that if you are trying out Unison you'll come talk to us, ask questions, and report bugs!
Step 2: Create your Unison codebase
ucm init to initialize a Unison codebase in
$HOME/.unison. This is where Unison will store function definitions, types, namespaces, and so on.
Step 3: Fetch the base libraries and run your first program
ucm again, then from the
.> prompt, do:
pull https://github.com/unisonweb/base:.releases._latest base
You'll see some output from
git in the background, and once that's done you'll see a big list of definitions that the
pull added. Press
q to exit the list of definitions.
Make a directory to work in, and create a new file there called
scratch.u with the following contents:
> List.map (x -> x * 10) [1,2,3,4,5,6]
A line beginning with
> is a watch expression, and this one multiplies every element in a list by
10, using the
ucm is not running launch it again in the folder you created.
ucm monitors all the unison source files in the current directory for changes and evaluates any watch expressions:
.> ✅ ~/ucm1/scratch.u changed. Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 1 | > List.map (x -> x * 10) [1,2,3,4,5,6] ⧩ [10, 20, 30, 40, 50, 60]
Congratulations, you ran your first Unison program!