Simply Data instance context for AmbiguousFieldOcc
authorRyan Scott <ryan.gl.scott@gmail.com>
Sat, 7 Oct 2017 21:59:07 +0000 (17:59 -0400)
committerRyan Scott <ryan.gl.scott@gmail.com>
Sat, 7 Oct 2017 21:59:11 +0000 (17:59 -0400)
The current, verbose instance context can be compacted into
`DataId pass`. Indeed, that's what most of the `Data` instances
in this module already do, so this just makes things consistent.

compiler/hsSyn/HsTypes.hs

index e9dea63..e9fc71b 100644 (file)
@@ -1129,10 +1129,7 @@ mkFieldOcc rdr = FieldOcc rdr PlaceHolder
 data AmbiguousFieldOcc pass
   = Unambiguous (Located RdrName) (PostRn pass (IdP pass))
   | Ambiguous   (Located RdrName) (PostTc pass (IdP pass))
-deriving instance ( Data pass
-                  , Data (PostTc pass (IdP pass))
-                  , Data (PostRn pass (IdP pass)))
-                  => Data (AmbiguousFieldOcc pass)
+deriving instance DataId pass => Data (AmbiguousFieldOcc pass)
 
 instance Outputable (AmbiguousFieldOcc pass) where
   ppr = ppr . rdrNameAmbiguousFieldOcc