I came back from Thanksgiving in California to find my copy of Real World Haskell had arrived. I've spent the last several days making my way through it up through chapter 10.
I'd read a few of the first chapters last year when I was struggling to learn Haskell, and posted enough comments that I'm amoung the (many many) people credited in the Preface. Amusing, since I still don't consider myself proficient in the language.
Reading back through those and on through Chapter Nine has swapped back in the basics I learned last year, and built on them. I was able to get all the way to Chapter Ten before hitting real brain-melting stumbling blocks. That's progess!
I can't help but feel that Chapter Ten should come later, perhaps after monads are covered. Only other quibbles so far are some typographical problems introduced in typesetting the book, and a few bugs and problems that were pointed out in comments on the web site, but not fixed in time for the first edition.
Anyway, I know more than enough Haskell now to configure
xmonad. While I'm still perfectly happy with
awesome
, xmonad has some cool things going for it. Playing with it this
evening, I especially like:
- Being able to compile my xmonad.hs and rely on Haskell's type checking to make sure I wrote it correctly and it will work.
- Xmonad's integration with gnome.
This was a nice suprise, and being able to just use the gnome panel in
xmonad, rather than building my own panel, has made it a lot easier to
get started with.
gnome panel showing xmonad workspaces - The power and beauty of xmonad's layouts. Start with the usual simple
sorts of layouts like tiled, full screen and floating. These can be
transformed in a myrid of ways (ie, rotated, decorations added), and can
even be combined together to create more complex layouts. So I was
quite easily able to configure it to alternate between a tabbed desktop
layout that plays nicely with panels, and absolute unadorned full-screen
mode:
myLayout = desktop ||| noBorders Full where desktop = tabbed $ ewmhDesktopsLayout $ avoidStruts $ twoPane tabbed = addTabsAlways shrinkText myTheme twoPane = Tall 1 2/3 3/100
(And it wasn't too hard to enhance this with a special-purpose grid layout for the workspace I run pidgin on.) - That my xmonad.hs
is small, easy to understand, and doesn't contain any
boilerplate beyond
main = xmonad $ gnomeConfig
. - It lets me muck about with doing something real with Haskell without having to commit to using it in some project of my own.
- It supports cycling all windows on screen so that each in turn
moves into the main viewport, via
XMonad.Actions.RotSlaves.rotAllUp
. An action that has been on my window manager wish-list for ages. Implemented in an easy 3 lines of code.
My current set of gripes with xmonad is small:
mod-shift-space
is documented somewhere, but not where you need it.- I applied
addTabsAlways
to aTall
layout, and got title-bar like "tabs". But how do I add multiple windows as tabs to a given frame, like in ion? Can't figure out how, or even if it's possible. - Moving the mouse cursor over one of the above title-bar-like things doesn't focus its window. Very annoying!
- Mouse support is very lacking. I'd like to be able to drag tabs around the screen, and maybe drag a border between frames to resize, couldn't find modules implementing any of that.
- Theme configuration is only partly factored out, some of it is scattered in several different places.
- Reloading the config file takes ages. 1.9 mb executable has to be built and run.
- The lack of a dynamic language shows; there's no way to open a prompt and
type Haskell into the window manager. I rarely speak
lua
toawesome
orion3
, but it's nice to have the ability there. I think it should be possible to do this with Haskell (seeghci
).