diff options
author | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-09-25 23:17:08 +0200 |
---|---|---|
committer | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-09-25 23:17:08 +0200 |
commit | 986691486083604be51bb57f7404609841444a7e (patch) | |
tree | 4053bb55cc6874f735343aa02463c8127d02b462 | |
parent | 435244b013cdd0edcddf1ec815d9fe81e1ac4c63 (diff) | |
download | xmonad-986691486083604be51bb57f7404609841444a7e.tar.gz xmonad-986691486083604be51bb57f7404609841444a7e.tar.xz xmonad-986691486083604be51bb57f7404609841444a7e.zip |
Simplify readLayout, comment on surprising behavior
darcs-hash:20070925211708-a5988-f814e1824247a7eb8b806811ea8cb7c73662e53f.gz
Diffstat (limited to '')
-rw-r--r-- | XMonad.hs | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -144,9 +144,9 @@ instance Show (SomeLayout a) where show (SomeLayout l) = show l readLayout :: [SomeLayout a] -> String -> [(SomeLayout a, String)] -readLayout ls s = case concatMap rl ls of - (x:_) -> [x] - [] -> [] +readLayout ls s = take 1 $ concatMap rl ls + -- We take the first parse only, because multiple matches + -- indicate a bad parse. where rl (SomeLayout x) = map (\(l,s') -> (SomeLayout l,s')) $ rl' x rl' :: Layout l a => l a -> [(l a,String)] rl' _ = reads s |