Skip to content

Annotations should not distinguish type and value

In HsDecls we have

data AnnDecl name = HsAnnotation (AnnProvenance name) (Located (HsExpr name))

data AnnProvenance name = ValueAnnProvenance name
                        | TypeAnnProvenance name
                        | ModuleAnnProvenance

And there's now a similar 3-way distinction in Template Haskell Syntax:

data AnnTarget = ModuleAnnotation
               | TypeAnnotation Name
               | ValueAnnotation Name

But there's really no need to distinguish between TypeAnnProvenance and ValueAnnProvenance (and similarly in the TH vesrion) because the namespace on the Name makes that distinction. So the current story is redundant, and hence has silly case where you have a ValueAnnProvenance on a type constructor.

Better to collapse the two. I'm making this a ticket so that people can comment. I hope that Gergely may be able to do it as part of his TH/annotation work.

Trac metadata
Trac field Value
Version 7.6.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information