[xmonad] Issue 230 in xmonad: Modular config support

codesite-noreply at google.com codesite-noreply at google.com
Fri Oct 24 16:40:24 EDT 2008

Issue 230: Modular config support

New issue report by amdragon:
XMonad.Core.recompile passes "-i" to ghc when compiling
~/.xmonad/xmonad.hs, making it impossible to break a configuration into
multiple modules.  This issue was previously discussed at:
but no resolution was reached.

Unfortunately, simply removing "-i" from the ghc arguments poses two
problems: (1) As discussed in the above thread, on case insensitive file
systems "import XMonad" will try to import "xmonad.hs" instead of the
XMonad module and (2) recompile's simple recompilation checker won't notice
changes to modules, since it only checks the modification time of xmonad.hs.

Personally, I'm not so concerned about (2), which could be fixed if
necessary using GHC's dependency generation mode.  (1) is a bigger problem,
for which I see a few possible solutions:

a. Change the name of the configuration file so it doesn't conflict with
any XMonad modules it may try to import.  For example, rename it to main.hs
or startup.hs or even config.hs (though the last one may cause confusion).
  This seems like the cleanest solution to me, but has obvious compatibility
drawbacks.  At least temporarily, recompile could check for the presence of
either main.hs or xmonad.hs and continue to compile the latter with "-i",
perhaps issuing an xmessage warning.

b. As suggested in the thread, create a convention for where to put
configuration-local modules, such as "~/.xmonad/lib" and pass this as the
"-i" argument.  Unfortunately, this behavior is unintuitive.

c. Allow the user to specify their own "-i" argument, perhaps in a plain
text file in ~/.xmonad/ or a magic comment in xmonad.hs.  This solution
seems like a hack and could lead to nasty surprises for people who try to
put "." in their import path.

I'd be happy to code up a patch for any of these if there's consensus.

Issue attributes:
	Status: New
	Owner: ----
	Labels: Type-Defect Priority-Medium

You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:

More information about the xmonad mailing list