Hiding import behaviour

Daniel Trstenjak daniel.trstenjak at gmail.com
Tue Oct 21 14:12:18 UTC 2014


Hi Erik,

> But right now, we have a useful property that adding imports and code
> to a module does not break or change other code in that module. With
> this extension, that changes.

So your biggest concern is about silent breakage of code, that suddenly
a different function is used which has the same name and type, but
different semantics.

In all other cases the compiler would throw an error, because the types
wouldn't match.

I have the feeling, that the proposal shouldn't be about implicit/explicit imports,
but about prefering the function with the fitting type.

If there're two functions with the same name and type in scope, then the
compiler most likely should always throw an error.

The only exception might be, if there's a function locally defined in the
module, then this one might be prefered over every imported one with the
same name and type. But perhaps even in this case it might be a good idea to
throw an error.


Greetings,
Daniel


More information about the Glasgow-haskell-users mailing list