On 07.01.2016 12:44, Brandon Allbery wrote:

On Thu, Jan 7, 2016 at 3:30 PM, Jakob Schöttl <jschoett@gmail.com> wrote:
For me it does not work, I don't know why.

myStartupHook = do
    args <- io getArgs
    spawn $ "xmessage " ++ show (length args)
    ...


Actually... I updated to 0.12 and at the same time switched from ghc 7.6.3 to 7.10.3, and found the same thing. I had to move the "args <- io getArgs" directly into "main" before invocation of the "xmonad" function.

I haven't yet looked at the code but this seems surprising. I also suspect it's not related to a change in xmonad, since the only core changes (and only a core change could have any effect here) were documentation.
That works! Thank you. Yeah it sounds like a GHC bug for me. I also have xmonad 0.12 and GHC 7.10.3.