summaryrefslogtreecommitdiffstats
path: root/Operations.hs
diff options
context:
space:
mode:
authorSpencer Janssen <sjanssen@cse.unl.edu>2007-09-20 22:57:11 +0200
committerSpencer Janssen <sjanssen@cse.unl.edu>2007-09-20 22:57:11 +0200
commitc3641121d9fd1d091882002a908f0661221b39b2 (patch)
tree696b3927c5517538e76e0e916521383043dc1afa /Operations.hs
parent71a7d6bd1426c61e5ecb3556b2d6d10bea488128 (diff)
downloadmetatile-c3641121d9fd1d091882002a908f0661221b39b2.tar
metatile-c3641121d9fd1d091882002a908f0661221b39b2.zip
Use derived Show and Read instances for Mirror
darcs-hash:20070920205711-a5988-822fbb9bc11937cccbc74252d6be2452cebedcd4
Diffstat (limited to 'Operations.hs')
-rw-r--r--Operations.hs8
1 files changed, 1 insertions, 7 deletions
diff --git a/Operations.hs b/Operations.hs
index 1cb0201..d18bd99 100644
--- a/Operations.hs
+++ b/Operations.hs
@@ -375,13 +375,7 @@ mirrorRect :: Rectangle -> Rectangle
mirrorRect (Rectangle rx ry rw rh) = (Rectangle ry rx rh rw)
-- | Mirror a layout, compute its 90 degree rotated form.
-data Mirror l a = Layout l a => Mirror (l a)
-instance Layout l a => Show (Mirror l a) where
- show (Mirror l) = "Mirror "++show l
-instance Layout l a => Read (Mirror l a) where
- readsPrec _ s = case take (length "Mirror ") s of
- "Mirror " -> map (\ (l,s') -> (Mirror l,s')) $ reads $ drop (length "Mirror ") s
- _ -> []
+data Mirror l a = Mirror (l a) deriving (Show, Read)
instance Layout l a => Layout (Mirror l) a where
doLayout (Mirror l) r s = do (wrs, ml') <- doLayout l (mirrorRect r) s