[Haskell-cafe] Syntax extension - adding import support to let/where bindings

mikael.brockman at gmail.com mikael.brockman at gmail.com
Thu Aug 6 10:16:51 UTC 2015

"Edward Z. Yang" <ezyang at mit.edu> writes:

> This should be a relatively straightforward extension to the renamer.
> But like others have mentioned, you should still be required to import
> anything you're going to use locally at the top-level.  This requirement
> makes it clear how instance visibility and dependency analysis should be
> done.  Plus, you probably want this anyway:
>     import qualified My.Qualified.DSL.CSS as CSS
>     ... where import CSS

I'm strongly in favor of something like this proposal.

Single-letter names for qualified modules seems to indicate the problem.

Also, operators. Qualified operators are very ugly; unqualified
operators are very confusing; explicit operator imports are tedious.

So, I would love this, for example:

| let import LensOperators in
|    (x ^%+ y <<++~ z) ^_^ k

I'm often torn between unqualified and qualified imports.

Qualified references are noisy and scary; unqualified references are
hard to track.  Block-level imports clarify references without noise.

So, +1!

-- Mikael Brockman

More information about the Haskell-Cafe mailing list