git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Use (..) for data constructors in suggestion
commit4569aa4664982c0f1a3c95427ca36c1d8006da46 authorGary Burgess <gary.burgess@gmail.com> dateMon 16 May 2016, 13:42 (10 years ago) parent4852b5d
1 file changed+9−1
src/Language/PureScript/Linter/Imports.hs+9−1
src/Language/PureScript/Linter/Imports.hs+9−1
@@ -213,7 +213,15 @@ lintImportDecl env mni qualifierName names declType allowImplicit =
213213 checkImplicit warning =
214214 if null allRefs
215215 then unused
216− else warn (warning mni allRefs)
216+ else warn (warning mni (map simplifyTypeRef allRefs))
217+ where
218+ -- Replace explicit type refs with data constructor lists from listing the
219+ -- used constructors explicity `T(X, Y, [...])` to `T(..)` for suggestion
220+ -- message.
221+ simplifyTypeRef :: DeclarationRef -> DeclarationRef
222+ simplifyTypeRef (TypeRef name (Just dctors))
223+ | not (null dctors) = TypeRef name Nothing
224+ simplifyTypeRef other = other
217225
218226 checkExplicit
219227 :: [DeclarationRef]