[Haskell-cafe] Progress indications

Andrew Coppin andrewcoppin at btinternet.com
Thu Nov 29 16:06:33 EST 2007


Bit Connor wrote:
> I was new to haskell when I made this program and when I ran the
> program for this first time I was expecting to experience a long pause
> and then a display of the final image. I was very surprised to see
> progressive rendering!
>   

Neat, isn't it? :-)

On the other hand, if you do something like sort a list, you cannot see 
the first element of the result until the entire unsorted list has been 
computed... which can take a heck of a long time, depending on what the 
computation is. And since it's all calls to map and filter et al., it's 
not immediately clear how to provide any feedback on how much longer 
there is to wait.

It seems unsafePerformIO is the way to go here.

(BTW, what's the difference between unsafePerformIO and unsafeInterleaveIO?)



More information about the Haskell-Cafe mailing list