1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 10:15:55 +03:00

Only need to pass one parameter to makeTraversalInstances.

This commit is contained in:
Patrick Thomson 2020-04-01 11:23:08 -04:00
parent 7b186f044c
commit 72b0702025

View File

@ -67,7 +67,7 @@ syntaxDatatype :: Ptr TS.Language -> [(String, Named)] -> Datatype -> Q [Dec]
syntaxDatatype language allSymbols datatype = skipDefined $ do
let extraTypeParameterName = mkName "f"
let typeParameterName = mkName "a"
let traversalInstances = makeTraversalInstances (varT extraTypeParameterName) (conT name)
let traversalInstances = makeTraversalInstances (conT name)
glue a b c = a : b <> c
name = mkName nameStr
generatedDatatype cons = dataD (cxt []) name [PlainTV extraTypeParameterName, PlainTV typeParameterName] Nothing cons [deriveStockClause, deriveAnyClassClause]
@ -102,8 +102,8 @@ syntaxDatatype language allSymbols datatype = skipDefined $ do
nameStr = toNameString (datatypeNameStatus datatype) (getDatatypeName (AST.Deserialize.datatypeName datatype))
makeTraversalInstances :: TypeQ -> TypeQ -> Q [Dec]
makeTraversalInstances ty _unused =
makeTraversalInstances :: TypeQ -> Q [Dec]
makeTraversalInstances ty =
[d|
instance Foldable ($ty f) where
foldMap = foldMapDefault1