[Haskell-cafe] Idea for hackage feature

Ivan Lazar Miljenovic ivan.miljenovic at gmail.com
Thu Sep 16 20:44:54 EDT 2010

On 17 September 2010 03:18, Henning Thielemann
<schlepptop at henning-thielemann.de> wrote:
> Ivan Lazar Miljenovic schrieb:
>> The problem with this is: unsafe* functions would be better called
>> "yesIGuaranteeThatUsingThisFunctionDoesResultInAReferentiallyTransparentEntityAndItsOKForMeToUseIt*".
>>  They are "unsafe" in that you shouldn't use them blindly.
> I think such a long and descriptive name would be helpful, since there
> seem to be many programmers, that do not know, that functions using
> unsafePerformIO must be referentially transparent.

Maybe we need more documentation then?  A better question is "why are
you using unsafePerformIO?" (then again, I know a first year student
that used it to get random numbers out of System.Random for an
assignment - when randomness wasn't needed - because he didn't
understand the explicit passing stuff we do and didn't bother asking).

> My suggestion is to move the Unsafe modules to a new package 'unsafe'.
> Then you can easily spot all "dirty" packages by looking at reverse
> dependencies of 'unsafe'.

Hooray, yet another supposedly stand-alone library that GHC will
depend on and thus can't be upgraded anyway, so there's no real
advantage of making it stand-alone (after all, doesn't base use
unsafeInterleaveIO or something for lazy IO?).

Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com

More information about the Haskell-Cafe mailing list