From d5773ee4e0e5717080a34a7b8a41c96671e5a388 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Sun, 24 Feb 2008 12:32:25 +0000 Subject: [PATCH] Changed two uses of gmapQ (const undefined) to the similar glength function in the SYB library --- GenTagAST.hs | 2 +- common/TreeUtils.hs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/GenTagAST.hs b/GenTagAST.hs index f60bdad..0ab4ef4 100644 --- a/GenTagAST.hs +++ b/GenTagAST.hs @@ -95,7 +95,7 @@ consFor x = map consFor' (dataTypeConstrs $ dataTypeOf x) -- The way I work out how many arguments a constructor takes is crazy, but -- I can't see a better way given the Data.Generics API consFor' :: Constr -> (Int, String) - consFor' con = (length (gmapQ (const undefined) (fromConstr con :: a)), showConstr con) + consFor' con = (glength (fromConstr con :: a), showConstr con) consParamsFor :: forall a. Data a => a -> [(Int, String, [String])] consParamsFor x = map consParamsFor' (dataTypeConstrs $ dataTypeOf x) diff --git a/common/TreeUtils.hs b/common/TreeUtils.hs index af5cc19..6f2800d 100644 --- a/common/TreeUtils.hs +++ b/common/TreeUtils.hs @@ -130,7 +130,7 @@ checkMatch m@(Match con items) b else (gmapQi index (checkMatch f) d) --Possibly a better way? where - numIndexes = length (gmapQ (const undefined) d) + numIndexes = glength d {-