Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
4,321
Issues
4,321
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
371
Merge Requests
371
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
84742c08
Commit
84742c08
authored
Feb 21, 2013
by
jpm@cs.ox.ac.uk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix
#7710
: do not AutoDeriveTypeable for synonyms and type families
parent
e7729b4d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
4 deletions
+15
-4
compiler/hsSyn/HsDecls.lhs
compiler/hsSyn/HsDecls.lhs
+14
-3
compiler/typecheck/TcDeriv.lhs
compiler/typecheck/TcDeriv.lhs
+1
-1
No files found.
compiler/hsSyn/HsDecls.lhs
View file @
84742c08
...
...
@@ -15,7 +15,8 @@ module HsDecls (
HsDecl(..), LHsDecl, HsDataDefn(..),
-- ** Class or type declarations
TyClDecl(..), LTyClDecl, TyClGroup,
isClassDecl, isDataDecl, isSynDecl, isFamilyDecl, tcdName,
isClassDecl, isDataDecl, isSynDecl, tcdName,
isFamilyDecl, isTypeFamilyDecl, isDataFamilyDecl,
tyFamInstDeclName, tyFamInstDeclLName,
countTyClDecls, pprTyClDeclFlavour,
tyClDeclLName, tyClDeclTyVars,
...
...
@@ -476,7 +477,7 @@ data FamilyDecl name = FamilyDecl
data FamilyFlavour
= TypeFamily
| DataFamily
deriving( Data, Typeable )
deriving( Data, Typeable
, Eq
)
\end{code}
...
...
@@ -500,10 +501,20 @@ isClassDecl :: TyClDecl name -> Bool
isClassDecl (ClassDecl {}) = True
isClassDecl _ = False
-- | type family declaration
-- | type
/data
family declaration
isFamilyDecl :: TyClDecl name -> Bool
isFamilyDecl (FamDecl {}) = True
isFamilyDecl _other = False
-- | type family declaration
isTypeFamilyDecl :: TyClDecl name -> Bool
isTypeFamilyDecl (FamDecl d) = fdFlavour d == TypeFamily
isTypeFamilyDecl _other = False
-- | data family declaration
isDataFamilyDecl :: TyClDecl name -> Bool
isDataFamilyDecl (FamDecl d) = fdFlavour d == DataFamily
isDataFamilyDecl _other = False
\end{code}
Dealing with names
...
...
compiler/typecheck/TcDeriv.lhs
View file @
84742c08
...
...
@@ -379,7 +379,7 @@ tcDeriving tycl_decls inst_decls deriv_decls
deriveTypeable tys =
[ L l (DerivDecl (L l (HsAppTy (noLoc (HsTyVar typeableClassName))
(L l (HsTyVar (tcdName t))))))
| L l t <- tys ]
| L l t <- tys
, not (isSynDecl t), not (isTypeFamilyDecl t)
]
-- Prints the representable type family instance
pprRepTy :: FamInst Unbranched -> SDoc
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment