Begun in March 2007, version 0.1 was announced[6] in April 2007 as 500 lines of Haskell[7] (which have since grown to 2000 lines). xmonad is a tiling window manager—akin to dwm, larswm, and StumpWM. It arranges windows in a non-overlapping pattern, and enables managing windows without using the mouse. xmonad is packaged and distributed on a wide range of Unix-like operating systems, such as a large number of Linux distributions, and Berkeley Software Distribution (BSD) systems.
While originally a clone of dwm (derivative in areas such as default keybindings), xmonad now supports features not available to dwm users[8][9] such as per-workspace layout, tiling reflection, state preservation, layout mirroring, GNOME support and per-screen status bars; it can be customised by modifying an external configuration file and 'reloaded' while running.[10] xmonad features have begun to influence other tiling window managers: dwm has borrowed "urgency hooks" from xmonad,[11] has also included Xinerama support (for multihead displays) with release 4.8, and patches exist to reimplement xmonad's Fibonacci layout.[12]
By utilising the expressivity of a modern functional language with a rich static type system, xmonad provides a complete, featureful window manager [...], with an emphasis on correctness and robustness. Internal properties of the window manager are checked using a combination of static guarantees provided by the type system, and type-based automated testing. A benefit of this is that the code is simple to understand, and easy to modify.[13]
Since xmonad's inception, when its small code size of 500 lines of code was advertised, it has grown to ca. 2000 lines in 2023.
Extensions to the core system, including emulation of other window managers, and unusual layout algorithms, such as window tiling based on the Fibonacci spiral—have been implemented by the active community[14] and are available as a library.[15]
Along with obviating the need for a mouse,[16] the xmonad developers make heavy use of semi-formal methods and program derivation for improving reliability and enabling a total line of code count less than 1200, as of version 0.7; window manager properties (such as the behavior of window focus) are checked through use of QuickCheck.[17] This emphasis makes xmonad unusual in a number of ways; besides being the first window manager written in Haskell, it is also the first to use the zipperdata structure for automatically managing focus, and its core has been proven to be safe with respect to pattern matches,[18] contributing further to reliability. The developers write:
xmonad is a tiling window manager for the X Window system, implemented, configured and dynamically extensible in Haskell. This demonstration presents the case that software dominated by side effects can be developed with the precision and efficiency we expect from Haskell by utilising purely functional data structures, an expressive type system, extended static checking and property-based testing. In addition, we describe the use of Haskell as an application configuration and extension language.[19]
The code is separated into side-effect free code, and a thin wrapper for the side-effects.[20] According to Alejandro Serrano Mena, there are two ways of implementing domain-specific languages for actions in Haskell applications and libraries: "developing a combinator library" or "rolling your own monad", with xmonad being a successful example of the latter.[21]
xmonad was regarded as one of the most well known Haskell projects in a 2013 functional programming book.[5]
Reception
Linux Magazine included xmonad in a list of "My Top Resources of 2009".[22] In 2012, How-To Geek described xmonad as having good, but complex, ability to be configured,[23] and it was included in a 2013 list of eight desktop environments for Linux.[24]Lifehacker wrote that the basic operations of xmonad's user interface can be taught using a small set of instructions.[25] A high level of customisation and speed were noted by Network World,[4] and in MakeUseOf xmonad was reviewed positively compared to Openbox.[26]
In 2016 Ars Technica said xmonad and Awesome had more advanced tiling ability than Cinnamon.[27] In 2017 it was described as powerful, with application as a windows manager for big data,[28] while in an article on opensource.com on the other hand, dwm was chosen over xmonad.[29] A TechRadar review of the "Best Linux desktop of 2018" said "If there's one desktop environment that stands out from all the others we have here, it's this one."[30]
Due to the small number of lines of code of the Xmonad application, the use of the purely functional programming language Haskell, and recorded use of a rigorous testing procedure it is sometimes used as a baseline application in other research projects. This has included re-implementation of xmonad using the Coq proof assistant,[31] a determination xmonad is an imperative program,[32] and studies of package management relating to the NixOS linux distribution.[33]
^Mitchell, Neil (June 2008). "6.5.5". Transformation and Analysis(PDF) (PhD). University of York. Archived(PDF) from the original on 12 September 2018. Retrieved 12 September 2018.
Lunduke, Bryan (2018-02-05). Half a Decade of Linux-y Shenanigans. Bryan Lunduke. p. 5. ISBN9781387571246. According to Bryan Lunduke xmonad is an unknown desktop environment written in an unknown programming language, adding "Are xmonad and Haskell failures? Are they dead? No. Because they are unique. They are customizable. They are alive and kicking (and awesome)."