on master help sign in
Fix parameter identification
a523c20Edwin Brady
src/Idris/Elab/Data.hs+9−2
@@ -132,8 +132,15 @@ elabData info syn doc argDocs fc opts (PDatadecl n t_in dcons)
132 -- them for repeated arguments
132 -- them for repeated arguments
133
133
134 findParams :: [Type] -> [Int]
134 findParams :: [Type] -> [Int]
135− findParams ts = let allapps = concatMap getDataApp ts in
135+ findParams ts = let allapps = map getDataApp ts
136+ -- do each constructor separately, then merge the results (names
137+ -- may change between constructors)
136− paramPos allapps
138+ conParams = map paramPos allapps in
139+ inAll conParams
140+
141+ inAll :: [[Int]] -> [Int]
142+ inAll [] = []
143+ inAll (x : xs) = filter (\p -> all (\ps -> p `elem` ps) xs) x
137
144
138 paramPos [] = []
145 paramPos [] = []
139 paramPos (args : rest)
146 paramPos (args : rest)