You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: STANDARDS.md
+46-14Lines changed: 46 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -269,6 +269,14 @@ Exceptions are granted when:
269
269
modules); or
270
270
*We have to import a datatype qualified as well.
271
271
272
+
Qualified imports of multiple modules MUSTNOT be imported under the same name.
273
+
Thus, the following is wrong:
274
+
275
+
```haskell
276
+
importqualifiedFoo.BarasBaz
277
+
importqualifiedFoo.QuuxasBaz
278
+
```
279
+
272
280
### Justification
273
281
274
282
Explicit export lists are an immediate, clear and obvious indication of what
@@ -298,12 +306,16 @@ qualified, is good practice, and saves on a lot of prefixing.
298
306
299
307
## Plutus module import naming conventions
300
308
301
-
In addition to the general module import rules, we should follow some conventions on how we import the PlutusAPI modules, allowing for some flexibility depending on the needs of a particular module.
302
-
303
-
Modules under the names `Plutus`, `Ledger` and `Plutus.V1.Ledger` SHOULD be imported qualified with their module name, as per the general module standards.An exception to this is `Plutus.V1.Ledger.Api`, where the `Ledger` name is preferred.
309
+
In addition to the general module import rules, we follow some conventions
310
+
on how we import the PlutusAPI modules, allowing for some flexibility
311
+
depending on the needs of a particular module.
304
312
305
-
Some other exceptions to this are allowed where it may be more convenient to avoid longer qualified names.
313
+
Modules under the names `Plutus`, `Ledger` and `Plutus.V1.Ledger` SHOULD
314
+
be imported qualified with their module name, as per the general module standards.
315
+
An exception to this is `Plutus.V1.Ledger.Api`, where the `Ledger` name is preferred.
306
316
317
+
Some other exceptions to this are allowed where it may be more convenient to
318
+
avoid longer qualified names.
307
319
308
320
For example:
309
321
@@ -321,11 +333,11 @@ In some cases it may be justified to use a shortened module name:
0 commit comments