Ignoring ANN Module "HLint: ..."

Moritz Angermann moritz.angermann at gmail.com
Sun Sep 24 05:51:22 UTC 2017


> On Sep 24, 2017, at 1:48 PM, Brandon Allbery <allbery.b at gmail.com> wrote:
> 
> On Sun, Sep 24, 2017 at 1:44 AM, Moritz Angermann <moritz.angermann at gmail.com> wrote:
> can we detect annotations like `{-# ANN module "HLint: ignore Reduce duplication" #-}` easily?
> Right now this will result (without -fexternal-interpreter or a stage2 compiler) in
> 
>   Ignoring ANN annotation, because this is a stage-1 compiler without -fexternal-interpreter or doesn't support GHCi
> 
> However, I do not see why this should require the external interpreter at all. This looks to me
> more like an informational comment?
> 
> As I understand it, ANNotations are intended for use with ghc plugins; hlint's use of them is not *quite* an abuse, since it is relying on haskell-src-exts handling of them rather than ghc's. 
> 
Hi Brandon,

I did not mean to imply abuse here.  Just that this kind of annotation should not trigger the external interpreter
route (if given).  While this might not have much of an impact with stage2 compilers, where the interpreter and
the compiler are essentially the same.  But in cases where this is not the case (read: external interpreter, possibly
on a different machine).  This results in unnecessary roundtrips, as far as I can see.

As such I’m wondering if we could teach GHC to ignore those easily?

Cheers,
 Moritz



More information about the ghc-devs mailing list