In response to this topic.
Instead of:
module [Request, Response, req]
import Json
import Unicode as Uc
import [Req, Resp] from InternalHttp
import [CodePoint, first] from CodePoint as Cp
import foo : Str from "some-file.txt"
I would prefer
module
exposes [
Request, Response, req
]
imports [
Json,
Unicode as Uc,
InternalHttp.{ Req, Resp },
(CodePoint as Cp).{ CodePoint, first },
"some-file.txt" as foo : Str,
]
While also allowing inline import, because this looks significantly cleaner.
interesting! I generally default to "one way to do it" but maybe this is so common that it's worth it?
I'm curious what others think!
My biggest concern with the import ... from syntax is that it seems backwards and inconsistent to me. I feel like the module name should come before its members. Also, if you don't specify the module name first, I don't think autocomplete will know where to look for members when you're first typing out the import.
We always could use the Something.{ SubThing } syntax with the individual import lines.
that doesn't work well with the WIP proposal though :sweat_smile:
I had this as import Foo exposing [Bar, Baz] previously, like how Elm does it
thoughts on that?
I'm good with that
I'd still prefer it with the imports list but the Foo exposing [Bar, Baz]part is good for me as well
Personally, I am not a fan of the import list as part of the header if we also have an import statement. I prefer to have one or the other. Since the import statement specifically enables extra wanted functionality, I would argue we should only support that.
Uhu, it's a reasonable choice, I could live with it :p
Last updated: Jun 16 2026 at 16:19 UTC