From 9733e389680ef92a90894ddfe85f833f9a4fead6 Mon Sep 17 00:00:00 2001 From: Spencer Janssen Date: Thu, 20 Sep 2007 22:57:11 +0200 Subject: Use derived Show and Read instances for Mirror darcs-hash:20070920205711-a5988-822fbb9bc11937cccbc74252d6be2452cebedcd4.gz --- Operations.hs | 8 +------- 1 file changed, 1 insertion(+), 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 -- cgit v1.2.3