[Xmonad] darcs patch: XSelection.hs: simplify creation of window (and 10 more)

David Roundy droundy at darcs.net
Tue Oct 23 09:34:43 EDT 2007


On Tue, Oct 23, 2007 at 11:29:34AM +0300, Valery V. Vorotyntsev wrote:
> On 10/19/07, gwern0 at gmail.com <gwern0 at gmail.com> wrote:
> > Fri Oct 19 14:13:17 EDT 2007  gwern0 at gmail.com
> >   * ShellPrompt.hs: fmt imports and update
> 
> The code looks somewhat polluted now. :)
> ``*Do not use explicit import lists*, except to resolve name clashes.''
>   - GHC Coding Style Guidelines,
>    <http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle>

There's a difference between coding a compiler and coding anything else.
SPJ's recommendation for libraries is to *always* use explicit import
lists, as this gives maximum forward-compatibility, since otherwise your
code could break when a new function is added to the imported module, due
to name clashes.  There was discussion recently (on haskell-cafe) of adding
a warning for imports without an import list.  I hope it gets added, as
it'll make it easier to enforce darcs' coding guidelines.  :)

I also prefer explicit import lists, because they make code easier to
read.  Rather than searching online for the docs to a half dozen modules,
trying to find out what a function means, you can go directly to the module
that exports that function.
-- 
David Roundy
Department of Physics
Oregon State University


More information about the Xmonad mailing list