-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some modules are not clickable in function signatures on package.elm-lang.org #35
Comments
Yeah, this is a known issue but tricky to resolve because Elm doesn't allow true cyclic dependencies between modules. However, the The current solution is to have all actual types defined in the module OpenSolid.Point3d
import OpenSolid.Geometry.Internal as Internal
type alias Point3d =
Internal.Point3d module OpenSolid.Axis3d
import OpenSolid.Geometry.Internal as Internal
type alias Axis3d =
Internal.Axis3d In most cases, modules can directly import the modules they depend on and just use the type aliases declared in those modules, for example module OpenSolid.Axis3d
import OpenSolid.Point3d exposing (Point3d) This means that the module OpenSolid.Point3d
import OpenSolid.Geometry.Internal expoing (Axis3d) Since this is actually the same type as the exposed alias in the The only way I can think of to solve this would be to have a public |
Unless you can think of some other clever solution =) But I've discussed this issue with a bunch of other experienced Elm developers and nobody has come up with a perfect answer. I may indeed end up switching to an import OpenSolid.Geometry.Types exposing (Point3d, Axis3d)
import OpenSolid.Point3d as Point3d
import OpenSolid.Axis3d as Axis3d and I prefer the more standard approach that the current structure allows: import OpenSolid.Point3d as Point3d exposing (Point3d)
import OpenSolid.Axis3d as Axis3d exposing (Axis3d) So yes, I think I'll close this for now - feel free to reopen if you have more ideas, and thanks for raising the issue! Now there's something I can link to the next time this comes up =) |
Yeah, the current approach definitely looks nicer. If I come up with a good solution you'll get PR directly 😉 Sorry for removing my previous comment. It felt obvious and I had hoped you hadn't read/started responding yet. For reference, it said: Thanks a lot for the thorough explanation! So this is pretty much unfixable, right? |
It occurs to me that splitting import OpenSolid.Primitives exposing (Point3d, Axis3d)
import OpenSolid.Point3d as Point3d etc. but import OpenSolid.Sphere3d as Sphere3d exposing (Sphere3d) I kind of like that...seems OK for the primitives to be a bit of a special case if it means everything else can be nice and clean. |
Have a look at the documentation for Point3d.distanceFromAxis
In the function signature
Point3d
is clickable and leads to thePoint3d
module and type.Axis3d
on the other hand isn't. It seems quite a few other modules have this issue as well.The text was updated successfully, but these errors were encountered: