Use clauses

Ause clausetells Unison to allowidentifiersfrom a givennamespaceto be usedunqualifiedin thelexical scopewhere the use clause appears.

In this example, theuse .base.Listclause allows the definition that follows it to refer to.base.List.takeas simplytake:

oneTwo = List.take 2 [1, 2, 3]

The general form ofuseclauses is as follows:

use namespace name_1 name_2 .. name_n

Wherenamespaceis the namespace from which we want to use names unqualified, andname_1throughname_nare the names we want to use. If no names are given in theuseclause, Unison allows all the names from the namespace to be used unqualified. There's no performance penalty for this, asuseclauses are purely a syntactic convenience. When rendering code as text, Unison will insert preciseuseclauses that mention exactly the names it uses, even if the programmer omitted the list of names.

See the section onidentifiersfor more on namespaces as well as qualified and unqualified names.