diff options
author | David Roundy <droundy@darcs.net> | 2007-05-27 21:11:53 +0200 |
---|---|---|
committer | David Roundy <droundy@darcs.net> | 2007-05-27 21:11:53 +0200 |
commit | ae03454010d00345f77565b4f3d76e65045c16b5 (patch) | |
tree | 82eace454d3f91e789cdf699badd31dc6d6de470 /Anneal.hs | |
parent | 42d36656cc17a26649d7feddd4ff10980cd4389b (diff) | |
download | XMonadContrib-ae03454010d00345f77565b4f3d76e65045c16b5.tar.gz XMonadContrib-ae03454010d00345f77565b4f3d76e65045c16b5.tar.xz XMonadContrib-ae03454010d00345f77565b4f3d76e65045c16b5.zip |
new layout algorithm for Mosaic.
darcs-hash:20070527191153-72aca-0ac95cbf4b53e4f307499f74e1ab73ef04ef1370.gz
Diffstat (limited to 'Anneal.hs')
-rw-r--r-- | Anneal.hs | 19 |
1 files changed, 19 insertions, 0 deletions
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 |