summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSpencer Janssen <sjanssen@cse.unl.edu>2007-05-08 18:38:22 +0200
committerSpencer Janssen <sjanssen@cse.unl.edu>2007-05-08 18:38:22 +0200
commit55cb5ce03c2c5294d1ca4cff12efa2d7c211ea53 (patch)
treefa733d33327772ce7b9b4bd2a1b93ac1838e5768
parent0cbd54c4f6a70c8fde46f5f0733906113bdd9766 (diff)
downloadmetatile-55cb5ce03c2c5294d1ca4cff12efa2d7c211ea53.tar
metatile-55cb5ce03c2c5294d1ca4cff12efa2d7c211ea53.zip
Remove unsafe fromJust
darcs-hash:20070508163822-a5988-cb12015569105b9e646a5c12fc8dc02099a4beed
-rw-r--r--StackSet.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/StackSet.hs b/StackSet.hs
index b7419f1..7607fb3 100644
--- a/StackSet.hs
+++ b/StackSet.hs
@@ -111,7 +111,7 @@ index k w = fmap (uncurry (++)) $ M.lookup k (stacks w)
view :: (Integral i, Integral j) => i -> StackSet i j a -> StackSet i j a
view n w | M.member n (stacks w)
= if M.member n (ws2screen w) then w { current = n }
- else tweak (fromJust $ screen (current w) w)
+ else maybe w tweak (screen (current w) w)
| otherwise = w
where
tweak sc = w { screen2ws = M.insert sc n (screen2ws w)