summaryrefslogtreecommitdiff
blob: 5f0c0d6edd77515bd157705448d743a57b6a8243 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
diff -urwpN darcs-1.0.8.orig/configure.ac darcs-1.0.8/configure.ac
--- darcs-1.0.8.orig/configure.ac	2006-06-16 20:59:29.000000000 +0200
+++ darcs-1.0.8/configure.ac	2006-09-18 23:15:25.000000000 +0200
@@ -110,6 +110,7 @@ WORKAROUND_POSIXSIGNALS([installHandler,
 dnl Look for Text.Regex
 
 GHC_CHECK_MODULE(Text.Regex( mkRegex, matchRegex, Regex ), text, mkRegex undefined)
+GHC_CHECK_MODULE(Text.Regex( mkRegex, matchRegex, Regex ), regex-compat, mkRegex undefined)
 
 dnl See if we need a package for QuickCheck
 
@@ -117,13 +118,17 @@ GHC_CHECK_MODULE(Debug.QuickCheck( quick
 
 dnl See if we need the util or mtl packages for Control.Monad
 
-GHC_CHECK_MODULE(Control.Monad.Error, util, putStr undefined)
-GHC_CHECK_MODULE(Control.Monad.Error, mtl, putStr undefined)
+GHC_CHECK_MODULE(Control.Monad.Error, util, strMsg "foo" :: String)
+GHC_CHECK_MODULE(Control.Monad.Error, mtl, strMsg "foo" :: String)
 
 dnl See if we need a package for parsec...
 
 GHC_CHECK_MODULE(Text.ParserCombinators.Parsec, parsec, errorPos undefined)
 
+dnl Check if we need package html
+
+GHC_CHECK_MODULE(Text.Html, html, text "foo")
+
 dnl Deal with systems on which getCurrentDirectory uses '\\' rather than '/':
 
 WORKAROUND_getCurrentDirectory
diff -urwpN darcs-1.0.8.orig/Lcs.lhs darcs-1.0.8/Lcs.lhs
--- darcs-1.0.8.orig/Lcs.lhs	2006-06-16 20:59:28.000000000 +0200
+++ darcs-1.0.8/Lcs.lhs	2006-09-18 22:28:38.000000000 +0200
@@ -358,7 +358,8 @@ shiftBoundaries c_a c_b p_a i_ j_ =
 -- | goto next unchanged line, return the given line if unchanged
 nextUnchanged :: BSTArray s -> Int -> ST s Int
 nextUnchanged c i = do
-  if i == (aLen c) + 1 then return i
+  len <- aLenM c
+  if i == len + 1 then return i
      else do b <- readArray c i
              if b then nextUnchanged c (i+1)
                 else return i
@@ -367,7 +368,8 @@ nextUnchanged c i = do
 --   behind the last line
 skipOneUnChanged :: BSTArray s -> Int -> ST s Int
 skipOneUnChanged c i = do
-  if i == (aLen c) + 1 then return i
+  len <- aLenM c
+  if i == len + 1 then return i
      else do b <- readArray c i
              if not b then return (i+1)
                 else skipOneUnChanged c (i+1)
@@ -381,8 +383,9 @@ nextUnchangedN c n i = do
 
 -- | goto next changed line, return the given line if changed
 nextChanged :: BSTArray s -> Int -> ST s (Maybe Int)
-nextChanged c i =
-  if i <= aLen c
+nextChanged c i = do
+  len <- aLenM c
+  if i <= len
     then do b <- readArray c i
             if not b then nextChanged c (i+1)
                else return $ Just i
@@ -430,8 +433,17 @@ initM a = listArray (0, length a) (0:a)
 initP :: [PackedString] -> PArray
 initP a = listArray (0, length a) (nilPS:a)
 
+#if __GLASGOW_HASKELL__ > 604
+aLen :: (IArray a e) => a Int e -> Int
+aLen a = snd $ bounds a
+aLenM :: (MArray a e m) => a Int e -> m Int
+aLenM a = getBounds a >>= return . snd
+#else
 aLen :: HasBounds a => a Int e -> Int
 aLen a = snd $ bounds a
+aLenM :: (HasBounds a, Monad m) => a Int e -> m Int
+aLenM = return . snd . bounds
+#endif
 \end{code}
 
 \begin{code}