Changed two uses of gmapQ (const undefined) to the similar glength function in the SYB library

This commit is contained in:
Neil Brown 2008-02-24 12:32:25 +00:00
parent 13c46d1fb2
commit d5773ee4e0
2 changed files with 2 additions and 2 deletions

View File

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

View File

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