Simplified the definition of mkPattern slightly

This commit is contained in:
Neil Brown 2008-02-15 17:16:20 +00:00
parent cd6e2175f2
commit e76ab116cb

View File

@ -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)