From e76ab116cba26d1c798f5ca4c031693b6c689004 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Fri, 15 Feb 2008 17:16:20 +0000 Subject: [PATCH] Simplified the definition of mkPattern slightly --- common/TreeUtils.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/TreeUtils.hs b/common/TreeUtils.hs index 9922b36..af5cc19 100644 --- a/common/TreeUtils.hs +++ b/common/TreeUtils.hs @@ -211,7 +211,7 @@ getMatchedItems a b --Therefore the whole function can be viewed as: get the constructor, and map mkPattern over the sub-elements mkPattern :: (Data a) => a -> Pattern -mkPattern x = case ((cast x) :: Maybe Pattern) of +mkPattern x = case cast x of Just x' -> x' Nothing -> Match (toConstr x) (gmapQ mkPattern x)