suggestions
suggestions copied to clipboard
Import all public functions/types from a module
Instead of explicitly having to import everything you want unqualified it would be useful to be able to import all at once https://gleam.run/tour/modules.html
import web/helpers.*
import web/helpers.{*types, *functions}
For something like a web controller there is a clear context and so not as much worry about tracing the origin of functions like set_header get_header etc.
You could even limit files to a single wildcard import to make it easier to find the definition of functions
I'm not a fan of the unqualified style and would not like to encourage its use. In the example you've given it does not seem like it would be unergonomic to either import the functions used or to write midas.set_header, perhaps you have other examples which might persuade me otherwise?
import http/methods.*
case route {
tuple(GET, []) ->
}
In my code I've been importing the ones I use and that's been fine, there's only really 4 in a REST app.
Ok, you might convince me on this. I've slimmed down the Midas API to only the functionality I actually used in my last two projects. There wasn't that much.
I'm ruminating on how valuable I think this would be