git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Update modules.rst
64bd2dbPhil Freeman
docs/source/modules.rst+20−20
@@ -1,29 +1,29 @@
1−## Modules
1+Modules
2+=======
2
3
3−Modules are introduced using the `module` keyword. All code must be placed in a module.
4+All code in PureScript is contained in a module. Modules are introduced using the `module` keyword::
4
5
5−Introduce a module as follows, with a list of declarations:
6+ module A where
7+
8+ id x = x
6
9
7−```haskell
10+When referencing values or data types in another module, names may be qualified by using a dot::
8−module A where
9
11
10−id x = x
12+ module B where
11−```
13+
14+ foo = A.id
12
15
13−Names may be qualified by using a dot:
16+Importing Modules
17+-----------------
14
18
15−```
19+A module can be imported using the `import` keyword. This will create aliases for all of the values and types in the imported module::
16−foo = A.id
17−```
18
20
19−All the names in a module can be aliased using the `import` declaration:
21+ module B where
22+
23+ import A
20
24
21−```haskell
25+Alternatively, a list of names to import can be provided in parentheses::
22−import A
23−```
24
26
25−You can also limit which names are going to be aliased:
27+ module B where
26−
28+
27−```haskell
28−import A (id)
29+ import A (id)
29−```