Inferring Safety

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Inferring Safety

Ivan Lazar Miljenovic
When it says up the top of Haddock docs that a module is
"Safe-Infered" (which should probably Safe-Infer*r*ed), what does that
actually mean?

My understanding of Safe Haskell is that there's no unsafe* functions,
etc. being used unless the module author swears (by using -XSafe) that
the module is indeed safe...

Yet as I pointed out on Google+ [1], the Data.GraphViz [2] module of
my graphviz package is labelled as being safe-infered, despite having
this function in there:

dotizeGraph           :: (Ord cl, Graph gr) => GraphvizParams Node nl el cl l
                         -> gr nl el -> gr (AttributeNode nl) (AttributeEdge el)
dotizeGraph params gr = unsafePerformIO
                        $ graphToGraph params' gr
  where
    params' = params { fmtCluster = const []
                     , fmtNode    = const []
                     , fmtEdge    = const []
                     }

This function uses `dot -Tcanon` to add in positional (as well as
possibly other) information to FGL graphs.  Now, as far as I know this
function _is_ safe (assuming that you have Graphviz installed), but I
certainly haven't proven it enough that for every possible input graph
the same positional attributes will be attached back (i.e. that the
graph will always be laid out the same), and thus I haven't used
-XSafe.

So what's going on here?

[1]: https://plus.google.com/101302416956767249890/posts/3NUWxd9P6xV
[2]: http://hackage.haskell.org/packages/archive/graphviz/2999.13.0.3/doc/html/Data-GraphViz.html

--
Ivan Lazar Miljenovic
[hidden email]
http://IvanMiljenovic.wordpress.com

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Inferring Safety

Joachim Breitner-2
Hi,

Am Mittwoch, den 04.07.2012, 21:10 +1000 schrieb Ivan Lazar Miljenovic:
> So what's going on here?

you are likely hit by
http://hackage.haskell.org/trac/ghc/ticket/5989

Greetings,
Joachim

--
Joachim "nomeata" Breitner
  [hidden email]  |  [hidden email]  |  GPG: 0x4743206C
  xmpp: [hidden email] | http://www.joachim-breitner.de/


_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe

signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Inferring Safety

Ivan Lazar Miljenovic
On 5 July 2012 01:35, Joachim Breitner <[hidden email]> wrote:
> Hi,
>
> Am Mittwoch, den 04.07.2012, 21:10 +1000 schrieb Ivan Lazar Miljenovic:
>> So what's going on here?
>
> you are likely hit by
> http://hackage.haskell.org/trac/ghc/ticket/5989

Ahhh, that looks like it; thanks Joachim.

>
> Greetings,
> Joachim
>
> --
> Joachim "nomeata" Breitner
>   [hidden email]  |  [hidden email]  |  GPG: 0x4743206C
>   xmpp: [hidden email] | http://www.joachim-breitner.de/
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> [hidden email]
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>



--
Ivan Lazar Miljenovic
[hidden email]
http://IvanMiljenovic.wordpress.com

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe