summaryrefslogtreecommitdiff
path: root/compiler/utils/Util.lhs
diff options
context:
space:
mode:
authorMax Bolingbroke <batterseapower@hotmail.com>2011-09-07 16:29:28 +0100
committerMax Bolingbroke <batterseapower@hotmail.com>2011-09-07 16:29:28 +0100
commita0d7ffbc9048c544f3186e0ece83582966c2cd07 (patch)
tree4d4d0a37cc39139cf0b334ea8589c68b60899568 /compiler/utils/Util.lhs
parent6d940f6ee90dc710f460dd9a587964c7bb07d528 (diff)
downloadhaskell-at-defaults.tar.gz
Don't generate a full TyCon for the AT defaultsat-defaults
Diffstat (limited to 'compiler/utils/Util.lhs')
-rw-r--r--compiler/utils/Util.lhs7
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/utils/Util.lhs b/compiler/utils/Util.lhs
index c5f1c0c2ed..6a15896fcb 100644
--- a/compiler/utils/Util.lhs
+++ b/compiler/utils/Util.lhs
@@ -44,7 +44,7 @@ module Util (
sortLe, sortWith, minWith, on,
-- * Comparisons
- isEqual, eqListBy,
+ isEqual, eqListBy, eqMaybeBy,
thenCmp, cmpList,
removeSpaces,
@@ -677,6 +677,11 @@ eqListBy _ [] [] = True
eqListBy eq (x:xs) (y:ys) = eq x y && eqListBy eq xs ys
eqListBy _ _ _ = False
+eqMaybeBy :: (a ->a->Bool) -> Maybe a -> Maybe a -> Bool
+eqMaybeBy _ Nothing Nothing = True
+eqMaybeBy eq (Just x) (Just y) = eq x y
+eqMaybeBy _ _ _ = False
+
cmpList :: (a -> a -> Ordering) -> [a] -> [a] -> Ordering
-- `cmpList' uses a user-specified comparer