mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-18 16:51:51 +03:00
937aa8fc43
Until now namespaces were stored as (reversed) lists of strings. It led to: * confusing code where we work on the underlying representation of namespaces rather than say what we mean (using `isSuffixOf` to mean `isParentOf`) * potentially introducing errors by not respecting the invariant cf. bug report #616 (but also name generation in the scheme backend although that did not lead to bugs as it was self-consistent AFAICT) * ad-hoc code to circumvent overlapping interface implementation when showing / pretty-printing namespaces This PR introduces a `Namespace` newtype containing a list of strings. Nested namespaces are still stored in reverse order but the exposed interface aims to support programming by saying what we mean (`isParentOf`, `isApproximationOf`, `X <.> Y` computes to `X.Y`, etc.) irrespective of the underlying representation. |
||
---|---|---|
.. | ||
TT.idr | ||
TTImp.idr |