Gabriella439 / pipes

Compositional pipelines
BSD 3-Clause "New" or "Revised" License
489 stars 72 forks source link

"Proxy" name clashes with Data.Proxy #43

Closed ehird closed 11 years ago

ehird commented 11 years ago

This clash is unfortunate as the two types have nothing to do with each other, and it seems like Proxy might be included in base as part of the new-typeable work (or at least a type variable proxy, used like proxy a -> ...).

Since 4.0 seems to be breaking backwards compatibility and removing all the older forms of pipes, how about renaming Proxy to Pipe, to match the library name?

ehird commented 11 years ago

Oh, I see the Pipe name is already in use... not sure what I suggest, then, but I think Proxy is a really unfortunate name.

Gabriella439 commented 11 years ago

I am definitely receptive to changing it since this version breaks a lot of backwards compatibility. It really depends on whether there is an equally descriptive name to replace it. Proxy suggests its behavior very accurately because a networking proxy has two interfaces, both of which send and receive data.

Gabriella439 commented 11 years ago

So another thing I want to mention is that the current Proxy type should be rarely used directly if ever, so I think this namespace clash is rather easy to resolve just by using:

import Pipes hiding (Proxy)

Also, they are very unlikely to be used in the same place, so I don't see this as having the potential to breed confusion. I think the main likely source of problems will be simply overlap in Google searches for either one.

Gabriella439 commented 11 years ago

So my decision is to tentatively keep the name Proxy for now. The networking connotation is very apt for what it does and I don't think that it will conflict much with Data.Proxy. The Proxy type will be very infrequently used in pipes programming, so this can very easily be resolved just by hiding Proxy from the Pipes import.

I will keep the issue open for a few more days just in case you have any other comments or suggestions for renames and if you don't have any issues then I will eventually close this.

ekmett commented 11 years ago

Note: that this will affect anyone who imports Data.Typeable as well from GHC 7.7 onward as that now re-exports Proxy.

That is a pretty common unqualified throw-away line in import lists.

Gabriella439 commented 11 years ago

I'm still reluctant to change it. The networking meaning of the word Proxy is more widespread and predates the other meaning. It's also a perfect metaphor for how the type behaves.

Also, anybody who is advanced enough to be using Data.Typeable and Pipes within the same module is advanced enough to know how to hide the Proxy import from Pipes:

import Pipes hiding (Proxy)

Normally I would solve this by not exporting Proxy by default, but this leads to even more intimidating type signatures when browsing or inferring types within ghci.