unisonweb-org
unisonweb-org copied to clipboard
Tour description doesn't match tour code example
I was reading "A tour of Unison" and found this part:
Now put the following in your scratch file:
square : [Nat](https://share.unison-lang.org/latest/types/@@Nat) -> [Nat](https://share.unison-lang.org/latest/types/@@Nat)
square x =
use Nat *
x [*](https://share.unison-lang.org/latest/terms/@@Nat.*) x
This defines a function called
square
.It takes an argument called
x
and it returns
x
multiplied by itself.
The first line,
use .base
,tells Unison that you want to use short names for the base libraries in this file (which allows you to say
[Nat](https://share.unison-lang.org/latest/types/@@Nat)
instead of having to say
base.Nat
).
The lower text mentions use .base
, but that is not mentioned in the snippet.