From fe5141d31062dd5bb47e1d4010a28609c3e6d09a Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Sat, 18 Aug 2007 11:09:37 +0000 Subject: [PATCH] Changed the Either order in TreeUtil of getMatchedItems to match Haskell convention --- TreeUtil.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/TreeUtil.hs b/TreeUtil.hs index 6c9dd3b..242bd8d 100644 --- a/TreeUtil.hs +++ b/TreeUtil.hs @@ -176,11 +176,11 @@ assertPatternMatch msg exp act = -- | A function for getting the matched items from the patterns on the LHS -- Either returns the matched items, or a list of errors from the matching -getMatchedItems :: (Data y, Data z) => y -> z -> Either Items MatchErrors +getMatchedItems :: (Data y, Data z) => y -> z -> Either MatchErrors Items getMatchedItems a b = case errors of - [] -> Left items - _ -> Right errors + [] -> Right items + _ -> Left errors where (errors,items) = runState (checkMatch (mkPattern a) b) (Map.empty)