aboutsummaryrefslogtreecommitdiff
path: root/src/content/chapter0_basics/lesson03_unqualified_imports/en.html
blob: 35ea10f616f93c5339a0c8b5e2f56b3ba498e5d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<p>
  Normally functions from other modules are used in a
  <em>qualified</em> fashion, meaning the name used to refer the module goes
  before function name with a dot between them. For example,
  <a href="https://hexdocs.pm/gleam_stdlib/gleam/io.html#println" target="_blank">
    <code>io.println("Hello!")</code>
  </a>.
</p>
<p>
  It is also possible to specify a list of functions to import from a module in
  an <em>unqualified</em> fashion, meaning the function name can be used without
  the module <em>qualifier</em> (the name and the dot) before it.
</p>
<p>
  Generally it is best to use qualified imports, as this makes it clear where
  the function is defined, making the code easier to read.
</p>