[Haskell-cafe] How to use unsafePerformIO properly (safely?)

Ivan Miljenovic ivan.miljenovic at gmail.com
Tue Mar 30 19:33:14 EDT 2010


I use the dreaded unsafePerformIO for a few functions in my graphviz
library ( http://hackage.haskell.org/packages/archive/graphviz/2999.8.0.0/doc/html/src/Data-GraphViz.html
).  However, a few months ago someone informed me that the
documentation for unsafePerformIO had some steps that should be
followed whenever it's used:
http://www.haskell.org/ghc/docs/latest/html/libraries/base-4.2.0.0/System-IO-Unsafe.html
.

Looking through this documentation, I'm unsure on how to deal with the
last two bullet points (adding NOINLINE pragmas is easy).  The code
doesn't combine IO actions, etc. and I don't deal with mutable
variables, so do I have to worry about them?

-- 
Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com
IvanMiljenovic.wordpress.com


More information about the Haskell-Cafe mailing list