projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0d7c6ce
)
Moving list-length code from one place in the file to another
author
simonpj@microsoft.com
<unknown>
Tue, 15 Aug 2006 16:19:47 +0000
(16:19 +0000)
committer
simonpj@microsoft.com
<unknown>
Tue, 15 Aug 2006 16:19:47 +0000
(16:19 +0000)
compiler/utils/Util.lhs
patch
|
blob
|
history
diff --git
a/compiler/utils/Util.lhs
b/compiler/utils/Util.lhs
index
279a108
..
8cd9e54
100644
(file)
--- a/
compiler/utils/Util.lhs
+++ b/
compiler/utils/Util.lhs
@@
-303,6
+303,18
@@
listLengthCmp = atLength atLen atEnd
atLen [] = EQ
atLen _ = GT
atLen [] = EQ
atLen _ = GT
+equalLength :: [a] -> [b] -> Bool
+equalLength [] [] = True
+equalLength (_:xs) (_:ys) = equalLength xs ys
+equalLength xs ys = False
+
+compareLength :: [a] -> [b] -> Ordering
+compareLength [] [] = EQ
+compareLength (_:xs) (_:ys) = compareLength xs ys
+compareLength [] _ys = LT
+compareLength _xs [] = GT
+
+----------------------------
singleton :: a -> [a]
singleton x = [x]
singleton :: a -> [a]
singleton x = [x]
@@
-648,17
+660,6
@@
eqListBy eq [] [] = True
eqListBy eq (x:xs) (y:ys) = eq x y && eqListBy eq xs ys
eqListBy eq xs ys = False
eqListBy eq (x:xs) (y:ys) = eq x y && eqListBy eq xs ys
eqListBy eq xs ys = False
-equalLength :: [a] -> [b] -> Bool
-equalLength [] [] = True
-equalLength (_:xs) (_:ys) = equalLength xs ys
-equalLength xs ys = False
-
-compareLength :: [a] -> [b] -> Ordering
-compareLength [] [] = EQ
-compareLength (_:xs) (_:ys) = compareLength xs ys
-compareLength [] _ys = LT
-compareLength _xs [] = GT
-
cmpList :: (a -> a -> Ordering) -> [a] -> [a] -> Ordering
-- `cmpList' uses a user-specified comparer
cmpList :: (a -> a -> Ordering) -> [a] -> [a] -> Ordering
-- `cmpList' uses a user-specified comparer