[Pkg-haskell-commits] darcs: haskell-debian: Make the Ord VersionReq instance total

Joachim Breitner mail at joachim-breitner.de
Mon May 3 12:59:17 UTC 2010


Mon May  3 12:48:04 UTC 2010  Joachim Breitner <mail at joachim-breitner.de>
  * Make the Ord VersionReq instance total
  Ignore-this: 22461b3070e365ccaeae081260b72e81

    M ./changelog +1
    M ./patches/series +1
    A ./patches/total-Ord-VersionReq.patch

Mon May  3 12:48:04 UTC 2010  Joachim Breitner <mail at joachim-breitner.de>
  * Make the Ord VersionReq instance total
  Ignore-this: 22461b3070e365ccaeae081260b72e81
diff -rN -u old-haskell-debian/changelog new-haskell-debian/changelog
--- old-haskell-debian/changelog	2010-05-03 12:59:17.674243010 +0000
+++ new-haskell-debian/changelog	2010-05-03 12:59:17.678243219 +0000
@@ -1,5 +1,6 @@
 haskell-debian (3.40-1) UNRELEASED; urgency=low
 
   * Initial release. 
+  * Make the Ord VersionReq instance total
 
  -- Joachim Breitner <nomeata at debian.org>  Thu, 01 Jan 1970 00:00:00 +0000
diff -rN -u old-haskell-debian/patches/series new-haskell-debian/patches/series
--- old-haskell-debian/patches/series	2010-05-03 12:59:17.674243010 +0000
+++ new-haskell-debian/patches/series	2010-05-03 12:59:17.674243010 +0000
@@ -1 +1,2 @@
 cabal-6.12.patch
+total-Ord-VersionReq.patch
diff -rN -u old-haskell-debian/patches/total-Ord-VersionReq.patch new-haskell-debian/patches/total-Ord-VersionReq.patch
--- old-haskell-debian/patches/total-Ord-VersionReq.patch	1970-01-01 00:00:00.000000000 +0000
+++ new-haskell-debian/patches/total-Ord-VersionReq.patch	2010-05-03 12:59:17.674243010 +0000
@@ -0,0 +1,37 @@
+Index: haskell-debian-3.40/Debian/Relation/Common.hs
+===================================================================
+--- haskell-debian-3.40.orig/Debian/Relation/Common.hs	2010-05-03 14:39:26.000000000 +0200
++++ haskell-debian-3.40/Debian/Relation/Common.hs	2010-05-03 14:47:46.000000000 +0200
+@@ -4,6 +4,7 @@
+ 
+ import Data.List
+ import Text.ParserCombinators.Parsec
++import Data.Function
+ 
+ -- Local Modules
+ 
+@@ -63,16 +64,15 @@
+     show (GRE v) = " (>= " ++ show v ++ ")"
+     show (SGR v) = " (>> " ++ show v ++ ")"
+ 
+--- |@FIXME:@ This instance is currently incomplete and only handles the case
+--- where two version requirements are equal.
++-- |The sort order is based on version number first, then on the kind of
++-- relation, sorting in the order <<, <= , ==, >= , >>
+ instance Ord VersionReq where
+-    compare r1 r2 =
+-	if r1 == r2 
+-	   then EQ 
+-	   else
+-	case (r1, r2) of
+-	     (EEQ v1, EEQ v2) -> compare v1 v2
+-	     (a,b) -> error $ "Ord VersionReq does not handle (" ++ show a ++", "++ show b++")"
++    compare = compare `on` extr
++      where extr (SLT v) = (v,0)
++            extr (LTE v) = (v,1)
++            extr (EEQ v) = (v,2)
++            extr (GRE v) = (v,3)
++            extr (SGR v) = (v,4)
+ 
+ 
+ -- |Check if a version number satisfies a version requirement.





More information about the Pkg-haskell-commits mailing list