Changed the Either order in TreeUtil of getMatchedItems to match Haskell convention

This commit is contained in:
Neil Brown 2007-08-18 11:09:37 +00:00
parent 7b81208794
commit fe5141d310

View File

@ -176,11 +176,11 @@ assertPatternMatch msg exp act =
-- | A function for getting the matched items from the patterns on the LHS -- | 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 -- 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 getMatchedItems a b
= case errors of = case errors of
[] -> Left items [] -> Right items
_ -> Right errors _ -> Left errors
where (errors,items) = runState (checkMatch (mkPattern a) b) (Map.empty) where (errors,items) = runState (checkMatch (mkPattern a) b) (Map.empty)