Created
August 25, 2015 23:48
-
-
Save JoeyEremondi/e304c8af399fdc865aa4 to your computer and use it in GitHub Desktop.
Storing interfaces with conflicting names--
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{- | |
Possible actions to take with conflicting names: | |
1. | |
Try to guess which one the user meant, by seeing if there's a name (or set of names) used | |
only found in one. | |
Give an error if this can't be determined. | |
2. | |
Add syntax for importing a package, something like | |
import package johnpmayer elm-linear-algebra as Lin | |
import Lin.Math.Vector4 | |
Then, give an error on any conficts not resolved this way | |
3. Always give an error, rely on package maintainers to avoid conflicting names. | |
-} | |
--Regardless, the correct answer is not "use whatever order Elm-make sees them" | |
--so here's a proposed change to allow for a fix | |
--AST.Module | |
type Interfaces = Map.Map Name [Interface] | |
--Elm.Compiler: | |
compile | |
:: Context | |
-> String | |
-> Map.Map PublicModule.Name [PublicModule.Interface] | |
-> (Dealiaser, [Warning], Either [Error] Result) | |
--Reporting.Error.Canonicalize | |
data ImportError | |
= ModuleNotFound [Module.Name] | |
| ValueNotFound String [String] | |
| AmbiguousImport [Var.PackageInfo] | |
--The idea is similar in Elm-make for reading interfaces | |
--We keep them in a dict of lists, not a dict of interfaces |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment