Having both unqualified import and named import #608
Replies: 5 comments
-
You can use use dict already? use aiken/list.{map} Still allows you to refer to list |
Beta Was this translation helpful? Give feedback.
-
What do you mean? I can use it, the module is in the
Ah, yeah it's nice. I think that could be used, the only minor problem is that it's not forced to use the |
Beta Was this translation helpful? Give feedback.
-
@KristianBalaj I don't exactly understand your comment. So let me just write code:
Alternatively
Does this not cover what you want? This works for Types, constructors, and functions |
Beta Was this translation helpful? Give feedback.
-
Ahh, you're right such a feature is already built into Aiken. What I was looking for is this kind of import:
My bad, I've mistakenly read the docs 🙌 |
Beta Was this translation helpful? Give feedback.
-
@KristianBalaj you don't need
Either way, and jokes aside, I'll glad you have what you need. |
Beta Was this translation helpful? Give feedback.
-
What is your idea? Provide a use case.
Let's take e.g. moudle
aiken/dict
.I want to import it using named import ie.
use aiken/dict as dict
for all the helper functions, but I would like to use theDict
type standalone without the module prefix ie.dict.Dict<...>
which is nasty imho.So the parser should be able to process the following correctly:
Why is it a good idea?
Convenience, easier to read - less clutter.
What is the current alternative and why is it not good enough?
Currently, you can have the same module imported just once no matter the type of import, so either use the named import or the unqualified import.
Beta Was this translation helpful? Give feedback.
All reactions