Treatment of unknown pragmas

Ben Gamari ben at
Tue Oct 16 22:19:14 UTC 2018

Ben Gamari <ben at> writes:

> Brandon Allbery <allbery.b at> writes:
>> The problem with ANN is it's part of the plugins API, and as such does
>> things like compiling the expression into the program in case a plugin
>> generates code using its value, plus things like recompilation
>> checking end up assuming plugins are in use and doing extra checking.
>> Using it as a compile-time pragma is actually fairly weird from that
>> standpoint.
> True. That being said, I wonder if we solve most of these issues by
> simply type-checking ANNs lazily. That is, just forkM ANNs during
> typechecking. This would mean that the user wouldn't see an error if the
> expression contained inside is invalid. On the other hand, the cost of
> ANNs would decrease significantly and plugins which use them would
> continue to work unmodified. Strict typechecking behavior could be
> enabled via a flag.
I suppose the only issue with this idea is that we would also need to
drop them from interface files, lest they would be forced. Perhaps this
is sometimes reasonable, however.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 487 bytes
Desc: not available
URL: <>

More information about the ghc-devs mailing list