Safe Haskell and Haskell Platform: near-term tactics

Gregory Collins greg at gregorycollins.net
Mon Jul 16 18:32:26 BST 2012


On Mon, Jul 16, 2012 at 6:48 PM, Yitzchak Gale <gale at sefer.org> wrote:

> Gregory Collins wrote:
> > I'm uncomfortable with this kind of a diktat without a plan for who's
> > actually going to do the work. Any volunteers?
>
> Well, "the work" is sending out a short email
> to the package maintainers of the packages
> that do not have Safe Haskell pragmas yet -
> about half of them. The email should
> be a request to add a Trustworthy pragma at
> the top of each publicly exposed module in
> their package, with a brief explanation.
>

This slightly underestimates the amount of work required. Each package's
api must be carefully audited for unsafe functions, you can't just slap a
"trustworthy" on everything and call it a day. If any legitimately unsafe
functions are found, the APIs need to be separated out into safe and unsafe
modules, and the old modules must go through a deprecation cycle.

Also, because I figured this might be your answer, I want to make it clear
that "emailing package authors and demanding that they do the legwork" is
the unfair scenario that I thought we should avoid. If advocates of Safe
Haskell want to insist that all of the platform packages are Safe
Haskell-clean, then I think the onus is on them to provide patches. Not to
mention, a large percentage of the platform packages are maintained by the
libraries community at large, there's no specific maintainer to harass.

A quick audit of platform packages:

   - Data.Text.Array is marked as "Safe-Inferred", but exports the
   following function:

   unsafeIndex :: Array -> Int -> Word16

   ...and a couple of other unsafe functions in the ST monad. This strikes
   me as quite problematic :(

   - regex-posix has lots of "unsafePerformIO"
   - network looks like it needs some work

Otherwise it looks like most of the packages should be ok as is. That said,
I think someone other than "grep" still needs to go through all of the
modules by hand :)

G
-- 
Gregory Collins <greg at gregorycollins.net>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://projects.haskell.org/pipermail/haskell-platform/attachments/20120716/e25c7c4c/attachment-0001.htm>


More information about the Haskell-platform mailing list