From ae03454010d00345f77565b4f3d76e65045c16b5 Mon Sep 17 00:00:00 2001 From: David Roundy Date: Sun, 27 May 2007 21:11:53 +0200 Subject: new layout algorithm for Mosaic. darcs-hash:20070527191153-72aca-0ac95cbf4b53e4f307499f74e1ab73ef04ef1370.gz --- Anneal.hs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Anneal.hs (limited to 'Anneal.hs') diff --git a/Anneal.hs b/Anneal.hs new file mode 100644 index 0000000..5083030 --- /dev/null +++ b/Anneal.hs @@ -0,0 +1,19 @@ +module XMonadContrib.Anneal ( Rated(Rated), the_value, the_rating, anneal ) where + +data Rated a b = Rated !a !b + deriving ( Show ) +instance Functor (Rated a) where + f `fmap` (Rated v a) = Rated v (f a) + +the_value :: Rated a b -> b +the_value (Rated _ b) = b +the_rating :: Rated a b -> a +the_rating (Rated a _) = a + +instance Eq a => Eq (Rated a b) where + (Rated a _) == (Rated a' _) = a == a' +instance Ord a => Ord (Rated a b) where + compare (Rated a _) (Rated a' _) = compare a a' + +anneal :: a -> (a -> Double) -> (a -> [a]) -> Rated Double a +anneal = undefined -- cgit v1.2.3