Hiding import behaviour
David Feuer
david.feuer at gmail.com
Thu Oct 16 23:22:16 UTC 2014
It should be good enough (for what you're talking about) to hide them all.
Turn
import A (foo)
import B (bar)
import C hiding (baz)
import D
into
import A (foo)
import B (bar)
import C hiding (foo,bar,baz)
import D hiding (foo,bar)
There's no reason to worry about hiding nonexistent identifiers, I don't
think.
On Thu, Oct 16, 2014 at 7:10 PM, htebalaka <goodingm at gmail.com> wrote:
> Well I suppose tooling might need to be aware of the feature depending on
> what it does, but I don't see why the code actually typechecking would need
> to be dependent on ordering. When I say shadowing I don't mean explicitly
> having any explicit import create a new scope, since in that case it would
> be sensitive to re-ordering, which I agree would be bad. My thought would
> be
> first you would need to parse all the imports to see which identifiers they
> import, then do another pass to change the imports to hide any identifiers
> that should be shadowed.
>
> So in the example I gave you would need to be aware that Foo exports x,
> because otherwise there would be no way to know that x needs to be hidden
> from Bar. I assume GHC already would have access to that information
> though.
>
>
>
> --
> View this message in context:
> http://haskell.1045720.n5.nabble.com/Hiding-import-behaviour-tp5758155p5758161.html
> Sent from the Haskell - Glasgow-haskell-users mailing list archive at
> Nabble.com.
> _______________________________________________
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users at haskell.org
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20141016/eec999e1/attachment.html>
More information about the Glasgow-haskell-users
mailing list