On 17 September 2010 03:18, Henning Thielemann <[email protected]> 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 [email protected] IvanMiljenovic.wordpress.com _______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
