[Haskell-cafe] "add ifM and whenM to Control.Monad" and other discussions like that

Alexander Solla alex.solla at gmail.com
Tue Apr 22 00:22:28 UTC 2014


On Mon, Apr 21, 2014 at 3:39 PM, Yuri de Wit <ydewit at gmail.com> wrote:

> I haven't been around for long in the Haskell community, but I have seen a
> few of these discussions taking long email rounds in different mailing
> lists.
>
> I don't have a strong opinion at this point to add my vote here or there
> one way or the other, and I do appreciate the effort made by everyone to
> find a sort of consensus, as hard as that can be sometimes.
>
> However, the question I keep asking myself is why can't the compiler
> disambiguate between two definitions with the same name based on the actual
> argument types?
>
> This would allow packages to choose their own names for functions without
> such global-naming discussions and without much pain when using them.
>
> e.g.:
>
> > import PackageA (when)
> > import PackageB (when)
>
> > when (Just True) doSomething
>
> versus:
>
> > when True 1
>
> Is there a theoretical or practical issue that makes this an undesirable
> feature in Haskell?
>

It has been discussed.

https://ghc.haskell.org/trac/haskell-prime/wiki/TypeDirectedNameResolution
http://thread.gmane.org/gmane.comp.lang.haskell.cafe/61723

There is no clear consensus, but it is on the docket for consideration for
a future version of the Haskell standard.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140421/6870e2a8/attachment.html>


More information about the Haskell-Cafe mailing list