[Haskell-cafe] Proposal: TypeDirectedNameResolution

Ketil Malde ketil at malde.org
Thu Jul 30 18:56:28 EDT 2009

Cale Gibbard <cgibbard at gmail.com> writes:

> There was a great related idea on #haskell the other day: Make
> explicit qualification unnecessary whenever there is a *unique* choice
> of module qualifications from those imported which would make the
> expression typecheck.


> This would mean that if we had, say, Data.List, Data.Map and Data.Set
> imported, and there was an occurrence of insert that happened to be
> applied to a couple of values and then something known to be a Map,


> What do people think of this idea? Personally, it really annoys me
> whenever I'm forced to give explicit module qualifications, and I
> think this would really help. It would also subsume the
> DisambiguateRecordFields extension rather handily.

My favorite annoyance is repeated import lines for each library just
to be able to use some unique identifiers unqualified, e.g.:

   import qualified Data.ByteString as B
   import Data.ByteString (ByteString)
   import qualified Data.Map as M
   import Data.Map (Map)
and so on.  I'm all for it, if for no other reason, then just to get
rid of this.

But I agree about the syntax: leave the dot out of it.

If I haven't seen further, it is by standing in the footprints of giants

More information about the Haskell-Cafe mailing list