Changed two uses of gmapQ (const undefined) to the similar glength function in the SYB library
This commit is contained in:
parent
13c46d1fb2
commit
d5773ee4e0
|
@ -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
|
-- 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
|
-- I can't see a better way given the Data.Generics API
|
||||||
consFor' :: Constr -> (Int, String)
|
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 :: forall a. Data a => a -> [(Int, String, [String])]
|
||||||
consParamsFor x = map consParamsFor' (dataTypeConstrs $ dataTypeOf x)
|
consParamsFor x = map consParamsFor' (dataTypeConstrs $ dataTypeOf x)
|
||||||
|
|
|
@ -130,7 +130,7 @@ checkMatch m@(Match con items) b
|
||||||
else (gmapQi index (checkMatch f) d)
|
else (gmapQi index (checkMatch f) d)
|
||||||
--Possibly a better way?
|
--Possibly a better way?
|
||||||
where
|
where
|
||||||
numIndexes = length (gmapQ (const undefined) d)
|
numIndexes = glength d
|
||||||
|
|
||||||
|
|
||||||
{-
|
{-
|
||||||
|
|
Loading…
Reference in New Issue
Block a user