[darcs-users] ratification (haskell_policy / hlint)

Neil Mitchell ndmitchell at gmail.com
Sun Sep 6 20:24:37 UTC 2009


Hi Jason,

>> I'd like this to be settled by consensus if possible.  But you know
>> where I stand if this keeps dragging out.
>
> I agree that explicit-per-use ratification is my preferred approach
> here.  I agree almost completely on the grounds of transparency.

In my generalised opinion explicit-per-use is the best approach for
safety - of course, I'm not hacking on darcs so your consensus
shouldn't include my opinion :-)

> Neil:  Is it possible for hlint to read comments?  As a random example:
> do c <- hGetContents h {-# HLINT: ignore "This use is safe." #-}
>   return c

GHC is sensitive about pragmas, but I'm sure I can come up with
something. I've thought about this before, and I think HLint probably
should have something. Any ideas? The issues are:

* Syntax - we need to choose something haskell-src-exts is happy
parsing and reading easily, but GHC doesn't choke/warn on.
* Scoping - my guess would be provide one way to turn it on/off, and
one method to apply the changes to the next declaration, and only put
hlint rules at declaration level.
* Features - we could have on/off control, or ability to add ignore
rules like are currently supported.

> Perhaps, it should work more like haddock where you use | and ^ to
> effectively point forward or backwards in the source at the usage.  I
> like the idea of being able to have a "comment" inside the ignore
> directive.

Yes, I think making sure there is a way to comment (and perhaps have a
flag to display all comments hlint encounters) is a sensible idea.

So in summary - great idea, if darcs decides that's the way to go,
I'll definitely implement it.

Sorry for the delay in replying, I've been at ICFP the last week.

Thanks

Neil


More information about the darcs-users mailing list