[Haskell-cafe] discouraging unsafePerformIO (Was: Debugging partial functions by the rules)

Henning Thielemann lemming at henning-thielemann.de
Thu Nov 16 11:46:22 EST 2006


On Wed, 15 Nov 2006 oleg at pobox.com wrote:

> ...
> I'd be quite happy seeing fromJust removed from the standard
> libraries, or at least tagged `deprecated' or with the stigma
> attached that is rightfully accorded to unsafePerformIO.

However, unsafe* functions are still recommended by Haskell users to
newbies, as if these functions belong to the normal usage. Maybe one
should add a string parameter to these functions, which must be bound to
"I confirm that I know that this function should be used only if really
necessary and that I checked properly that safe alternatives do not
exist.". The unsafe* function must be undefined, if the confirmation
argument does not match. :-)


More information about the Haskell-Cafe mailing list