summaryrefslogtreecommitdiffstats
path: root/XMonad.hs
diff options
context:
space:
mode:
authorSpencer Janssen <sjanssen@cse.unl.edu>2007-09-25 23:17:08 +0200
committerSpencer Janssen <sjanssen@cse.unl.edu>2007-09-25 23:17:08 +0200
commit3e949bb931cd91d9558a58f37ce389a2bd676ee6 (patch)
tree4053bb55cc6874f735343aa02463c8127d02b462 /XMonad.hs
parentf156bd3f2b4fbd9d4153245a6fd148af57929f06 (diff)
downloadmetatile-3e949bb931cd91d9558a58f37ce389a2bd676ee6.tar
metatile-3e949bb931cd91d9558a58f37ce389a2bd676ee6.zip
Simplify readLayout, comment on surprising behavior
darcs-hash:20070925211708-a5988-f814e1824247a7eb8b806811ea8cb7c73662e53f
Diffstat (limited to 'XMonad.hs')
-rw-r--r--XMonad.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/XMonad.hs b/XMonad.hs
index 0d66d25..6e7cdd4 100644
--- a/XMonad.hs
+++ b/XMonad.hs
@@ -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