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 to initialize a Unison codebase in
$HOME/.unison. This is where Unison will store function definitions, types, namespaces, and so on. By default, the UCM will begin downloading the standard library, called
base, which you'll use to write Unison code. It may take a moment!
Run your first program
Back in your terminal, 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!