[Haskell-cafe] Re: How to variables/O'Haskell

Donn Cave donn at drizzle.com
Tue Jul 19 13:58:55 EDT 2005


On Tue, 19 Jul 2005, robert dockins wrote:
[ ... re explicit "entire program state" record passing ... ]

> Fair enough.  The main reason I suggested it is a fairly painless way to 
> emulate global variables within a main control loop, which was the OPs 
> stated goal.  ("it's important to implement it in as most imperative 
> form as possible...")
> 
> I would personally attempt to adopt a more functional way of approaching 
> the problem (Arrows and whatnot), but those are still pretty murky waters.

Bummer.  It's as simple and obvious as it could be in O'Haskell,
which as I understand it basically packages up your record of IORefs,
in its reactive object.  The I/O event driven execution model seems
meant for problems like this, too.  I hope if the links people ever
spawn a new FP language and it's anything like Haskell, they'll take
an approach somewhat like this and leave the Haskell world fumbling
around with its Arrows and whatnot.

But, to try to answer the recent question about O'Haskell, I wouldn't
expect it to serve very well as a bridge to OO languages.  There are
some OO elements, but for example if you read to the bottom of
http://www.cs.chalmers.se/~nordland/ohaskell/survey.html, there are
also some significant omissions.  For example, he doesn't use this
phrase, but I think there's no "open recursion".  I can't imagine
using this language's OO features in a C++ toolkit wrapper.  But I
never tried it, and it might be an interesting demonstration project.

	Donn Cave, donn at drizzle.com



More information about the Haskell-Cafe mailing list