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: docs/mkDocs/docs/specifications.md
+19-2Lines changed: 19 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -377,10 +377,27 @@ see [tests/pos/Map.hs](https://github.com/ucsd-progsys/liquidhaskell/blob/develo
377
377
378
378
**Syntax:**The key requirements for type aliases are:
379
379
380
-
1.Type parameters are specified in**lower**case:`a`, `b`, `c` etc.
380
+
1.Type parameters go first andare specified in**lower**case:`a`, `b`, `c` etc.
381
381
2.Value parameters are specified in**upper**case: `X`, `Y`, `Z` etc.
382
382
383
-
##InfixOperators
383
+
**Import/Export:**Type aliases are exported and imported according to the following:
384
+
385
+
1.When importing a module, alltype aliases from its transitive dependencies are brought into scope.
386
+
2.If a module is imported qualified, its type aliases must also be referenced with a qualifier.
387
+
3.Locally defined aliases can shadow those from dependencies that share the same unqualified name.
388
+
In this case, only the local alias is stored in the resulting specification.
389
+
This makes possible to effectively _update_ an alias definition.
390
+
4.When imports contain aliases with identical symbols, name resolution triggers
391
+
an error upon ambiguous usage.Resolve this by qualifying either:
392
+
-The usage
393
+
-The import
394
+
-Or both
395
+
5.When the same alias name is imported from multiple modules (with no local definition),
396
+
only the lexicographically last instance is exported (i.e., included in the resulting specification).
397
+
398
+
See [tests/names/pos/ImportedTypeAlias.hs](https://github.com/ucsd-progsys/liquidhaskell/blob/develop/tests/names/pos/ImportedTypeAlias.hs) for examples.
399
+
400
+
##InfixOperators
384
401
385
402
You can define infix types and logical operators in logic [Haskell'sinfix notation](https://www.haskell.org/onlinereport/decls.html#fixity).
386
403
For example, if `(+++)` is defined as a measure or reflected function, you can use it infix by declaring
0 commit comments