Comments (1)
Another use case to consider:
In elm-pages
I'm using this pattern which some package authors use to keep some internals accessible within the package. I have a type alias that is in an "exposed module" in the package. It has the same name as the actual internal definition.
import DataSource.Internal.Glob exposing (Glob(..))
type alias Glob a =
DataSource.Internal.Glob.Glob a
I get this error
(fix) NoModuleOnExposedNames: Module used on exposed type `Glob`.
224| type alias Glob a =
225| DataSource.Internal.Glob.Glob a
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
It is not necessary to use the module here as `Glob` was exposed on import.
You should remove the module from this call, or remove the name from the import
.. exposing list.
However, that would result in an invalid Elm module if I followed that fix:
-- ALIAS PROBLEM - elm-pages/src/DataSource/Glob.elm
This type alias is recursive, forming an infinite type!
224| type alias Glob a =
^^^^
When I expand a recursive type alias, it just keeps getting bigger and bigger.
So dealiasing results in an infinitely large type! Try this instead:
type Glob a =
Glob
(Glob a)
Hint: This is kind of a subtle distinction. I suggested the naive fix, but I
recommend reading <https://elm-lang.org/0.19.1/recursive-alias> for ideas on how
to do better.
from elm-review-imports.
Related Issues (15)
- Ensure Consistent Aliases
- Check for default exposes HOT 1
- Shadowing when aliasing a type with the same name HOT 2
- Forbid aliases for certain imports HOT 1
- Discussion: Allow multiple aliases? HOT 4
- Alternate way to configure consistent alias rule HOT 2
- NoModuleOnExposedName fix can introduce name collision HOT 6
- Enforce preferred names
- Applying the fix doesn't always update instances of Module.Constructor HOT 3
- Enforce consistency for every alias
- Shadowing issue with record pattern matching for NoModuleOnExposedNames
- Enforce use of an alias when one is known
- Do not allow exposed names to be qualified HOT 1
- False negative on `Json.Decode` when `Json.Decode.Extra` import is also present
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elm-review-imports.