[darcs-users] ratification (haskell_policy / hlint)

Eric Kow kowey at darcs.net
Sun Sep 19 07:43:41 UTC 2010

On Sat, Sep 18, 2010 at 22:13:59 +0100, Neil Mitchell wrote:
> {-# ANN module "HLint: ignore" #-}
> There are also more fine grained options available, described in the manual.

Thanks for getting back to us :-)


  {-# ANN map "HLint: ignore" #-} - don't give any hints in the function map.

map is an example of a function we would write?

As an example of ratification at work, we have

getLog :: forall x y . [DarcsFlag] -> Maybe (String, [String]) -> IO String -> FL Prim x y ->
           IO (String, [String], Maybe String)
getLog opts m_old make_log chs = gl opts
    where -- some lines of code removed ...
          gl (Pipe:_) = do p <- case patchname_specified of
                                  FlagPatchName p  -> return p
                                  PriorPatchName p -> return p
                                  NoPatchName      -> prompt_patchname False
                           putStrLn "What is the log?"
                           thelog <- lines `fmap` Ratified.hGetContents stdin
                           return (p, thelog, Nothing)
         -- more lines of code removed

And here instead we'd be using something like

  {-# ANN getLog "HLint: ignore Avoid hGetContents" #-}

If that's the case, we may just stick with the qualified Ratified module import
for now, so that we can have very fine grained control [eg. we may have some
uses of hGetContents in getLog that we would not want to ratify]

The module is more than the attached, and if you're curious, attached is the
current errors file we're using in Haskell policy-checking mode.


Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
For a faster response, try +44 (0)1273 64 2905 or
xmpp:kowey at jabber.fr (Jabber or Google Talk only)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-users/attachments/20100919/4ff78678/attachment.pgp>

More information about the darcs-users mailing list