Unison


A new approach to

Unison is a friendly programming language from the future: statically-typed, functional, and a lot of fun 😄

$
On Apple Silicon? You'll need Rosetta to run Unison.
$

How does Unison code look?

💡 All parts of the code examples are interactive. Click a dependency to read its definition and docs.

👋 Hello World

The classic Hello World program in Unison is as simple as a call to printLine.

helloWorld : '{IO, Exception} ()
helloWorld _ = printLine "Hello World"

{IO, Exception} indicates which abilities the program needs to do I/O and throw exceptions.

'
is used to denote a delayed computation.

Learn more about Abilities.

Distributed map-reduce

With a few lines of code, you can perform a distributed map-reduce using the Remote ability.

distributed : Seq k Nat ->{Remote} Nat
distributed dseq =
  dseq
    |> Seq.map (x -> x + 1)
    |> Seq.filter (x -> mod x 7 == 0)
    |> Seq.reduce 0 (+)

Learn more about Remote and working with distributed datasets in Unison.

HTTP request

Perform effectful code, like HTTP requests with Abilities and Ability handlers.

Checkout more HTTP examples in the http library.

httpEx : '{IO, Exception} HttpResponse
httpEx =
  do Http.run do Http.get (parseOrBug "https://www.unison-lang.org")

What's it like to write Unison code?

The Unison Codebase Manager (UCM) is by your side as you write, guiding you through the
development process; adding, updating, and running your programs.

Editor : ~/scratch.u
Terminal : UCM - Unison Codebase Manager
👋 Welcome to Unison!

.> 

              

Unison at a glance: get a complete overview of Unison with many more examples.

Learn More