Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

Tour description doesn't match tour code example #315

Open
evmar opened this issue Jun 18, 2022 · 1 comment
Open

Tour description doesn't match tour code example #315

evmar opened this issue Jun 18, 2022 · 1 comment

Comments

@evmar
Copy link

evmar commented Jun 18, 2022

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.

@evmar
Copy link
Author

evmar commented Jun 18, 2022

It looks like a later snippet does use .base so I think it's just maybe a bit out of order(?)

A few paragraphs later I similarly see "Notice that Unison inserts precise use statements when rendering your code." just after a snippet that doesn't have any "use" statements.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant