[update GenUtil.hs
John Meacham <john@repetae.net>**20050721092336] hunk ./GenUtil.hs 2
---  $Id: GenUtil.hs,v 1.40 2005/02/02 11:55:22 john Exp $
+--  $Id: GenUtil.hs,v 1.42 2005/07/21 09:22:10 john Exp $
hunk ./GenUtil.hs 7
--- 
+--
hunk ./GenUtil.hs 15
--- 
+--
hunk ./GenUtil.hs 18
--- 
+--
hunk ./GenUtil.hs 37
-    -- ** Error reporting 
+    -- ** Error reporting
hunk ./GenUtil.hs 39
-    -- ** Simple deconstruction 
+    -- ** Simple deconstruction
hunk ./GenUtil.hs 45
-    liftT2, liftT3, liftT4, 
+    liftT2, liftT3, liftT4,
hunk ./GenUtil.hs 61
-    shellQuote, simpleQuote, simpleUnquote, 
+    shellQuote, simpleQuote, simpleUnquote,
hunk ./GenUtil.hs 137
-groupUnder :: Eq b => (a -> b) -> [a] -> [[a]]  
+groupUnder :: Eq b => (a -> b) -> [a] -> [[a]]
hunk ./GenUtil.hs 152
-minimumUnder f [] = error "minimumUnder: empty list"
+minimumUnder _ [] = error "minimumUnder: empty list"
hunk ./GenUtil.hs 158
-            fx = f x 
+            fx = f x
hunk ./GenUtil.hs 161
-maximumUnder f [] = error "maximumUnder: empty list"
+maximumUnder _ [] = error "maximumUnder: empty list"
hunk ./GenUtil.hs 167
-            fx = f x 
+            fx = f x
hunk ./GenUtil.hs 175
-putErrLn s = IO.hFlush IO.stdout >> IO.hPutStrLn IO.stderr s 
+putErrLn s = IO.hFlush IO.stdout >> IO.hPutStrLn IO.stderr s
hunk ./GenUtil.hs 178
--- | Flush stdout, write string and newline to standard error, 
+-- | Flush stdout, write string and newline to standard error,
hunk ./GenUtil.hs 184
--- | exit program successfully. 'exitFailure' is 
+-- | exit program successfully. 'exitFailure' is
hunk ./GenUtil.hs 202
-repMaybe f e = case f e of 
+repMaybe f e = case f e of
hunk ./GenUtil.hs 227
---	modifyUniq (+1) 
+--	modifyUniq (+1)
hunk ./GenUtil.hs 291
-     
+
hunk ./GenUtil.hs 297
-splitEither  (r:rs) = case splitEither rs of 
-    (xs,ys) -> case r of 
+splitEither  (r:rs) = case splitEither rs of
+    (xs,ys) -> case r of
hunk ./GenUtil.hs 317
-mapFsts f xs = [(f x, y) | (x,y) <- xs] 
+mapFsts f xs = [(f x, y) | (x,y) <- xs]
hunk ./GenUtil.hs 345
-        lx = length x + 1    
+        lx = length x + 1
hunk ./GenUtil.hs 353
-chunkText :: Int -> String -> String 
+chunkText :: Int -> String -> String
hunk ./GenUtil.hs 357
-paragraphBreak :: Int -> String -> String 
+paragraphBreak :: Int -> String -> String
hunk ./GenUtil.hs 361
-        (ss,rs) = span isSpace xs  
+        (ss,rs) = span isSpace xs
hunk ./GenUtil.hs 363
-        (ns,rs) = span (not . isSpace) xs  
+        (ns,rs) = span (not . isSpace) xs
hunk ./GenUtil.hs 367
-paragraphBreak :: Int -> String -> String 
+paragraphBreak :: Int -> String -> String
hunk ./GenUtil.hs 373
-            (ea, sa) = span (not . isSpace) $ reverse a 
+            (ea, sa) = span (not . isSpace) $ reverse a
hunk ./GenUtil.hs 402
-    f as' [] c = f as' bs c  
+    f as' [] c = f as' bs c
hunk ./GenUtil.hs 405
- 
+
hunk ./GenUtil.hs 426
--- | quote a set of strings as would be appropriate to pass them as 
+-- | quote a set of strings as would be appropriate to pass them as
hunk ./GenUtil.hs 459
-isConjoint xs ys = or [x == y | x <- xs, y <- ys] 
+isConjoint xs ys = or [x == y | x <- xs, y <- ys]
hunk ./GenUtil.hs 462
--- | 'concat' composed with 'List.intersperse'. Can be used similarly to join in perl. 
+-- | 'concat' composed with 'List.intersperse'. Can be used similarly to join in perl.
hunk ./GenUtil.hs 467
-indentLines :: Int -> String -> String 
-indentLines n s = unlines $ map (replicate n ' ' ++)$ lines s 
+indentLines :: Int -> String -> String
+indentLines n s = unlines $ map (replicate n ' ' ++)$ lines s
hunk ./GenUtil.hs 494
-count f = length . filter f 
+count f = length . filter f
hunk ./GenUtil.hs 521
-(x:xs) /\/ ys = x : (ys /\/ xs)        
+(x:xs) /\/ ys = x : (ys /\/ xs)
hunk ./GenUtil.hs 538
--- | determine if two closed intervals overlap at all. 
+-- | determine if two closed intervals overlap at all.
hunk ./GenUtil.hs 551
-        st _ 0 = "" 
+        st _ 0 = ""
hunk ./GenUtil.hs 556
--- arguments are given, read stdin. 
+-- arguments are given, read stdin.
hunk ./GenUtil.hs 569
-    as <- System.getArgs 
-    (as,o1,o2) <- parseOpt args as 
+    as <- System.getArgs
+    (as,o1,o2) <- parseOpt args as
hunk ./GenUtil.hs 577
-    
+
hunk ./GenUtil.hs 579
-parseOpt :: Monad m => 
+parseOpt :: Monad m =>
hunk ./GenUtil.hs 592
-        z (xs,ys,zs) (c:cs) 
+        z (xs,ys,zs) (c:cs)
hunk ./GenUtil.hs 630
---                                                                                      
---   > tokens (=='a') "aabbaca"                                                         
---   > ["bb","c"]                                                                         
-tokens :: (a -> Bool) -> [a] -> [[a]]                                                   
-tokens p = filter (not.null) . split p                                
+--
+--   > tokens (=='a') "aabbaca"
+--   > ["bb","c"]
+tokens :: (a -> Bool) -> [a] -> [[a]]
+tokens p = filter (not.null) . split p
hunk ./GenUtil.hs 641
-        cw = [ maximum (map length xs) | xs <- transpose ts] 
-    es n s = replicate (n - length s) ' ' ++ s 
+        cw = [ maximum (map length xs) | xs <- transpose ts]
+    es n s = replicate (n - length s) ' ' ++ s
hunk ./GenUtil.hs 644
--- | time task 
+-- | time task
hunk ./GenUtil.hs 648
-    x <- action 
+    x <- action
hunk ./GenUtil.hs 656
-    f (p:ps) (s:ss) 
-        | p == s = f ps ss  
-        | otherwise = fail $ "getPrefix: " ++ a ++ " " ++ b 
+    f _  [] = fail "getPrefix: value too short"
+    f (p:ps) (s:ss)
+        | p == s = f ps ss
+        | otherwise = fail $ "getPrefix: " ++ a ++ " " ++ b
+