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

gwern0:
On 2007.10.23 15:19:32 -0700, Don Stewart
scribbled 0 lines: mailing_list:
Regarding the style: I hope that Don will come up with some coding convention I remember he was talking about.
I've added a document called STYLE to the xmonad core, with initial advice on required style for new code.
Feel free to send suggestions in.
-- Don
Done.
But I notice there's nothing about how imports should be done. We've heard from myself, Roundy, and Andrea. How is XMonad going to do them? Implicit vs. explicit, alphabetical vs. by first use vs. by commonness by... there are a lot of options, and I think this is one of the things it'd be better to just have you and sjanssen declare by fiat.
I favour no import lists these days. -- Don

gwern0:
On 2007.10.23 15:19:32 -0700, Don Stewart
scribbled 0
On Tuesday 23 October 2007 18:03:21 Don Stewart wrote: lines:
mailing_list:
Regarding the style: I hope that Don will come up with some coding convention I remember he was talking about.
I've added a document called STYLE to the xmonad core, with initial advice on required style for new code.
Feel free to send suggestions in.
-- Don
Done.
But I notice there's nothing about how imports should be done. We've heard from myself, Roundy, and Andrea. How is XMonad going to do them? Implicit vs. explicit, alphabetical vs. by first use vs. by commonness by... there are a lot of options, and I think this is one of the things it'd be better to just have you and sjanssen declare by fiat.
I favour no import lists these days.
-- Don
In general, I don't feel strongly either way. Explicit imports can clarify, but only to a point. Consider this code that was recently contributed: import System.Environment (getEnv) import Control.Monad (Monad((>>=), return), Functor(..), filterM, forM) import Data.List ((++), concat, filter, map, lines, elem, span, tail, last, isPrefixOf) import Data.Set (toList, fromList) import System.Directory (Permissions(executable), getPermissions, getDirectoryContents, doesDirectoryExist, doesFileExist) import System.IO (IO, FilePath) import XMonadContrib.Run (runProcessWithInput, safeSpawn, unsafeSpawn) import XMonad (X, io, spawn) import XMonadContrib.XPrompt (XPrompt(..), XPConfig, mkXPrompt) In my opinion, this solid wall of imports only serves to obfuscate. Cheers, Spencer Janssen

On Tue, Oct 23, 2007 at 04:03:21PM -0700, Don Stewart wrote:
I favour no import lists these days.
I'm a relative newb, so take my style comments with the appropriate amount of Navium Chloride, but I favour no blanket statements these days. Partly influence by XMonad's code itself, I've been using a mixture of: * explicit imports, for where I'm only using a couple functions (e.g Control.Monad.State (gets) ) * unqualified imports, for where I'm using a bunch, and its use it quite core to what I'm doing (e.g. XMonad) * qualified imports, for where I'm using a medium-sized amount, or where popular naming conflicts[1] exist (e.g. Data.Set vs Data.List vs StackSet) I find that's worked fairly well for me, but I haven't yet Haskelled "in the large." Devin [1] Sometimes they're not actual naming conflicts, like intersect vs intersection, but it's close enough that it deserves distinction.
participants (3)
-
Devin Mullins
-
Don Stewart
-
Spencer Janssen