Annotations

Gergely Risko gergely at risko.hu
Wed Nov 6 12:42:00 UTC 2013


On Wed, 6 Nov 2013 10:55:09 +0000, Simon Peyton-Jones <simonpj at microsoft.com> writes:

> I’ve just noticed that there is no GHC language extension for
> annotations
>
> http://www.haskell.org/ghc/docs/latest/html/users_guide/extending-ghc.html#annotation-
> pragmas
>
> That feels like an oversight. Yes, they are in a pragma, but you may
> get an error message if you compile with a stage-1 compiler, for
> example. Plus, the language extensions should truthfully report what
> extra stuff you are using.

And are you more inclined because of the stage-1 incompatibility or
because of the second reason: "the language extensions should truthfully
report what extra stuff you are using".

Because in the second case, then maybe we should do the same for:
  - inlining,
  - SPECIALIZE,
  - unpacking,
  - rules.

All of these also have TH implementation, so the same kind of issue
would arise for them.

I agree that my issue is orthogonal, but I still see it as important.
For example when generating small boilerplate functions via TH, then you
almost always want to add the INLINE pragma without bothering the user.

I'd vote for doing this (even only for annotations, if you only want
that).  But would really like to handle the TH issue at the same time.

About MultiParamTypeClasses, I think you're correct.  But I'm not so
sure that this is general for ALL the language pragmas, I'll try them
out and report back if I find further inconsistencies.

Gergely



More information about the ghc-devs mailing list