diff options
author | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-11-01 16:23:02 +0100 |
---|---|---|
committer | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-11-01 16:23:02 +0100 |
commit | cea3e0dfd8b4f1b1fcab1ce85947a040174ac902 (patch) | |
tree | b5fab07fe16bb3fbd085770992596aa4831f7c7c | |
parent | 58f44a028428a30b3b6cc8e32039b48b9066841a (diff) | |
download | metatile-cea3e0dfd8b4f1b1fcab1ce85947a040174ac902.tar metatile-cea3e0dfd8b4f1b1fcab1ce85947a040174ac902.zip |
Layouts.Choose: handle ReleaseResources
darcs-hash:20071101152302-a5988-8e1379ea75eb0423007776e9ea4e9d293f61840e
-rw-r--r-- | Layouts.hs | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -71,6 +71,14 @@ instance (LayoutClass l a, LayoutClass r a) => LayoutClass (Choose l r) a where mr <- handleMessage r (SomeMessage FirstLayout) return . Just . SRight l $ fromMaybe r mr + handleMessage lr m | Just ReleaseResources <- fromMessage m = + liftM2 ((Just .) . cons) + (fmap (fromMaybe l) $ handleMessage l m) + (fmap (fromMaybe r) $ handleMessage r m) + where (cons, l, r) = case lr of + (SLeft r l) -> (flip SLeft, l, r) + (SRight l r) -> (SRight, l, r) + -- The default cases for left and right: handleMessage (SLeft r l) m = fmap (fmap $ SLeft r) $ handleMessage l m handleMessage (SRight l r) m = fmap (fmap $ SRight l) $ handleMessage r m |