[Haskell-cafe] Use unsafePerformIO to catch Exception?

Jonathan Cast jonathanccast at fastmail.fm
Wed Mar 25 13:09:06 EDT 2009


On Wed, 2009-03-25 at 10:00 -0700, Donn Cave wrote:
> Quoth Jonathan Cast <jonathanccast at fastmail.fm>:
> > On Wed, 2009-03-25 at 09:15 -0700, Donn Cave wrote:
> 
> >> OK, these are interesting phenomena.  From a practical point of view,
> >> though, I could see someone weighing the potential costs and benefits
> >> of a exception handler outside IO like this, and these effects might
> >> not even carry all that much weight.
> >
> > Well, sure.  From a purely `practical' point of view, I don't know why
> > you would even use a purely functional language (as opposed to trying to
> > minimize side effects in an impure language).  But if you're not
> > concerned about purity, or ease of equational reasoning, or accuracy of
> > a wide range of compiler transformations/optimizations/because it makes
> > the generated code pretty to sort the formal parameters by name before
> > forcing them-implementation decisions, then please do not use Haskell.
> > There are many other languages that are suitable for what you want to
> > do, and it would be a courtesy to those of us who *do* use Haskell
> > because it is purely functional, not to have to explicitly exclude your
> > library from our picture of the language's capabilities.
> 
> Concerned about purity, ease of equational reasoning, etc.?  Sure ...
> but I guess hoping we can agree on practical reasons for interest in
> these things, as opposed to, or at least in addition to, their esthetic
> or religious appeal.  I'm guessing you would likewise,

Nope.  You must not have been following my positions in previous
discussions.  I am committed to functional purity for its own sake (just
as I am committed to software development for its own sake; don't you
*dare* suggest using Global Script!)

> if only because
> a solely esthetic appeal is difficult angle to pursue because people's
> esthetic sensibilities aren't guaranteed to line up very well.  And in
> fact the way I read the responses so far in this thread, the range of
> attitudes towards the matter seems pretty wide to me, among people whose
> views I respect.

> So I thought it would be interesting to explore statements like "you
> must not do this", and "pure Haskell is not allowed to be
> non-deterministic", in terms of practical effects.  No one would
> make a statement like that and not hope to be challenged on it?

What?  Challenged by people who think Haskell should not be a purely
functional language?  I mean, that's kind of what it is.  Again, if you
don't want to use a purely functional language, there are *lots* of
impure languages out there.  There's no need to turn Haskell into one of
them.

jcc




More information about the Haskell-Cafe mailing list