-
Notifications
You must be signed in to change notification settings - Fork 46
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
Qualified import #221
Comments
Given:
Then this is OK:
And this is OK:
But this will fail to compile:
Importing only works for exported functions and is a way to drop qualification, it won't expose an un-exported function from, for example, |
Oops! Too much Haskell and Elm. I presumed some sort of import statement is always required. Thanks! |
Is it possible to alias a long module name? Something like |
Not at present, no. I'm totally fine with seeing that feature added though it'd be low priority for my own personal work queue. Probably not a huge change, can probably accomplish this with a rewrite in |
OCaml's syntax for that would be much nicer: module User = My_app_data |
I didn't want to imply this would go as far as a first module system :) |
Aww, but the beam VM would so very well support first-class modules. ^.^ |
I'm working on a reading list for this :) (mostly because I have a lot to learn) |
Oh if you have questions about first class modules, higher polymorphic modules, Functors, or basically anything else in OCaml, I can explain in detail. :-) HPT's (like OCaml's Module system) is significantly more powerful than essentially all of Haskell's typing system alone as it can emulate, for example, even typeclasses (as a VERY simple example) but significantly more performant in compilation time (and with no runtime costs over standard dispatch, which even that is optimizable out with a couple simple passes). All while HPT's have a singular syntax representation unlike Haskell's type system horrors. :-) |
I may yet take you up on that :) Currently I'm still intrigued by the possibilities in 1ML but need to dig in more. I'm thinking we do need something that synthesizes Erlang modules out of Alpaca sig+module combinations, it's just not at the very top of my list yet :D (algebraic effects and the FFI are other large-scale/scope things to figure out too, along the lines of discussion in #7). |
Hello!
I prefer to qualify my imported functions by default as I believe that the module name on the call makes it much clearer where functions are defined. Is there a way to import functions in a qualified way? It seems that
import module.function
permits both qualified and unqualified calls of the imported function.Cheers,
Louis
The text was updated successfully, but these errors were encountered: