[darcs-users] ratification (haskell_policy / hlint)

Eric Kow kowey at darcs.net
Wed Sep 2 13:11:51 UTC 2009


On Tue, Sep 01, 2009 at 10:55:36 -0400, Gwern Branwen wrote:
> I see the point fine; you are guarding against a small edgecase that I
> don't think will ever happen, using a mechanism that is quite complex
> and unusual. I don't think the former is worth the latter - given that
> the banned functions are things like 'hGetContents' which are usually
> used only once per executable...

It's all about tradeoffs, right?  Here it looks like ugliness and
complexity VS. granularity and transparency.  Personally, I think we
should use a explicit ratification mechanism.

For those of you who are lost in this thread, the context is that
we want to get rid of our cobbled-together haskell_policy script and use
hlint instead.  For banned functions, we need to make exceptions where
use of banned functions is acceptable. One proposal is to use a 'Ratify'
wrapper module.  An alternative approach is to use a feature in hlint
(pointed out by Neil) which lets us ignore specific violations in any
given function:

  ignore "hGetContents" = Darcs.External.pipeDoc

Granularity: We've touched on the fact that the 'ignore' mechanism does
not catch cases where a forbidden function is used more than once in a
given function.  The explicit ratification mechanism would force us to
ratify each and every use.

Transparency: Explicit ratification is more transparent; you get
something baked right into the source file "yes, this is a banned
function, but we are using it because it's acceptable in this specific
context"

I'd like this to be settled by consensus if possible.  But you know
where I stand if this keeps dragging out.

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-users/attachments/20090902/54fe8d68/attachment.pgp>


More information about the darcs-users mailing list