Skip to content
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

Importing and Implicit Arguments? #875

Open
crides opened this issue Aug 22, 2020 · 0 comments
Open

Importing and Implicit Arguments? #875

crides opened this issue Aug 22, 2020 · 0 comments

Comments

@crides
Copy link

crides commented Aug 22, 2020

Is the ? in let io @ { ? } = import! std.io for bringing in the implicit argument implementations, so let io = import! std.io and let io @ { ? } = import! std.io only differs in how the implicit arguments are searched, but what resides in io is the same? If so, how does the compiler chooses the implementation for implicit arguments, and I'm assuming the implementations for a certain type comes from the module that contains the type (so std.monad.Monad for std.io.IO resides in std.io.IO.monad)? If yes, why not just look inside the module instead of a implicit argument registry? In other words, is there any case where someone would want to import some type from a module and not import the implicit argument implementations? Sorry for a lot of questions!

Edit: I originally noticed this by thinking that the ? is like * in use gluon::*, as a glob import, but found out this is not working:

let io = import! std.io
seq io.wrap ()
io.wrap ()

where Implicit parameter with type `std.monad.Monad std.io.IO` could not be resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant