import ModuleWithToString
toString typeFromThatModuleimport ModuleWithToString exposing (..)
toString typeFromThatModule"Qualified imports are preferred."http://elm-lang.org/docs/syntax#modules
--
You received this message because you are subscribed to the Google Groups "Elm Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I can’t search for the thread right now, but I’m sure you can find it yourself via the archive. In any case, one aspect of it (but I think there were more) was this: https://github.com/elm-lang/elm-make/issues/61
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+unsubscribe@googlegroups.com.
A function called
With a name likeState.runStateis redundant and silly. More importantly, it encourages people to useimport State exposing (..)which does not scale well. In files with many so-called "unqualified" dependencies, it is essentially impossible to figure out where functions are coming from. This can make large code bases impossible to understand, especially if custom infix operators are used as well. Repeating the module name actively encourages this kind of unreadable code.State.runthe user is encouraged to disambiguate functions with namespacing, leading to a codebase that will be clearer to people reading the project for the first time. A great example from the standard library isBitwise.and
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+unsubscribe@googlegroups.com.
> import Module1WithToX exposing (toX)
> import Module2WithToX
> toX "r"
"rr" : String
> import Module1WithToX exposing (..)
> import Module2WithToX exposing (..)
> toX "r"
-- NAMING ERROR ---------------------------------------------- repl-temp-000.elm
This usage of variable `toX` is ambiguous.
5| toX "r"
^^^
Maybe you want one of the following?
Module1WithToX.toX
Module2WithToX.toX
Module1WithToX exposing (..)*. Do Module1WithToX.toX. Your code will be clearer, and it will not be ambiguous which one you mean.To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+unsubscribe@googlegroups.com.
import ModuleWithToString
toString typeFromThatModuleCompiles with unexpected results that you have to catch.import ModuleWithToString exposing (..)
toString typeFromThatModule
Doesn't compile: "use of toString is ambiguous: did you mean Basics.toString or ModuleWithToString.toString?"
Okay, I see the usability problem now. But I don’t think it calls for always importing with exposing (..). Maybe it does call for a warning to be issued in such situations by the compiler or by an optional code quality tool.
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+unsubscribe@googlegroups.com.