Re: The (Interactive) Glasgow Haskell Compiler -- version 5.00

2001-04-18 Thread Manuel M. T. Chakravarty

> > The (Interactive) Glasgow Haskell Compiler -- version 5.00
> >
> 
> RPM packages for x86 built on RedHat Linux 7.0/glibc 2.2 are
> now available at
> 
>   ftp://ftp.cse.unsw.edu.au/pub/users/chak/jibunmaki/i386/ghc-5.00-2.i386.rpm
>   ftp://ftp.cse.unsw.edu.au/pub/users/chak/jibunmaki/i386/ghc-prof-5.00-2.i386.rpm

There are now also x86 RPMS for RedHat Linux 6.2 at

  ftp://ftp.cse.unsw.edu.au/pub/users/chak/jibunmaki/i386-rh6.2/ghc-5.00-2.i386.rpm
  
ftp://ftp.cse.unsw.edu.au/pub/users/chak/jibunmaki/i386-rh6.2/ghc-prof-5.00-2.i386.rpm

This build has been kindly contributed by Tom Moertel.

Manuel

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



how to implement timeouts for IO operations?

2001-04-18 Thread Johannes Waldmann


what is the Right Way to impose a timeout condition on IO actions?
the GHC manual says ( http://www.haskell.org/ghc/docs/5.00/set/select.html )
"use threadDelay and  asynchronous exceptions". When I do this:

timed :: Int -> IO a -> IO a
timed d action = do

let timer = do
threadDelay d
throw $ AssertionFailed "timer expired"

t <- forkIO timer
x <- action
killThread t
return x

it seems to work, but how do I turn off the "Fail: thread killed" messages?

-- 
-- Johannes Waldmann  http://www.informatik.uni-leipzig.de/~joe/ --
-- [EMAIL PROTECTED] -- phone/fax (+49) 341 9732 204/252 --

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



AW: Haskell2Xml - Some questions

2001-04-18 Thread Lescher Christian

> > - Is there any support for floating point numbers (e.g. Double)?
> 
> XML does not (as far as I know) have any built-in concept of floating
> point numbers, so neither does HaXml.  However, within HaXml you
> have the full power of Haskell available to you, so if you wish to
> read, write, or process Doubles from/to some string content (or element
> attributes), you can probably code it yourself quite easily.
> 
In case of Haskell2Xml, what about a conversion like this:

  

Is this easy to implement?

Regards, Christian


___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



Re: how to implement timeouts for IO operations?

2001-04-18 Thread Marcin 'Qrczak' Kowalczyk

Wed, 18 Apr 2001 14:52:12 +0200 (MET DST), Johannes Waldmann 
<[EMAIL PROTECTED]> pisze:

> it seems to work, but how do I turn off the "Fail: thread killed" messages?

import Exception

t <- block $ forkIO $ catchJust asyncExceptions
(unblock timer)
(\_ -> return ())

Perhaps the message about killing a thread will not appear in future
versions of ghc. A discussion about it on this list stopped six
weeks ago.

-- 
 __("<  Marcin Kowalczyk * [EMAIL PROTECTED] http://qrczak.ids.net.pl/
 \__/
  ^^  SYGNATURA ZASTÊPCZA
QRCZAK


___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



Re: how to implement timeouts for IO operations?

2001-04-18 Thread Johannes Waldmann

Thank you, Marcin. 

Your reply seems to imply that the structure
of the program I posted was basically OK?


A slightly related point, I was having difficulties with TimeDiff 
values - I got negative tdPicosecs sometimes,
and some functions (show) even dumped core.

Are such problems known (I am using a binary ghc-4.08)?
For the moment, I switched to Posix.EpochTime.


I found TimeDiff and ClockTime quite restrictive:
they are not instances of Num, I can't add/subtract/negate TimeDiffs;
and I cannot generate a zero ClockTime.
(In my application, I need to simulate two clocks,
where always one is running, the other one is stopped -
as used in tournament Chess.)

-- 
-- Johannes Waldmann  http://www.informatik.uni-leipzig.de/~joe/ --
-- [EMAIL PROTECTED] -- phone/fax (+49) 341 9732 204/252 --

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



Re: how to implement timeouts for IO operations?

2001-04-18 Thread Michael Weber

On Wed, Apr 18, 2001 at 21:36:04 +0200, Johannes Waldmann wrote:
> A slightly related point, I was having difficulties with TimeDiff 
> values - I got negative tdPicosecs sometimes,
> and some functions (show) even dumped core.
> 
> Are such problems known (I am using a binary ghc-4.08)?
> For the moment, I switched to Posix.EpochTime.
> 
> 
> I found TimeDiff and ClockTime quite restrictive:
> they are not instances of Num, I can't add/subtract/negate TimeDiffs;
> and I cannot generate a zero ClockTime.
> (In my application, I need to simulate two clocks,
> where always one is running, the other one is stopped -
> as used in tournament Chess.)

Despite my humble try, TimeDiff and ClockTime (Time.lhs) are still
b0rked.  Use on your own risk (and read the comments at the top).
Sorry for that...


Cheers,
Michael

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



Re: how to implement timeouts for IO operations?

2001-04-18 Thread Tom Pledger

Johannes Waldmann writes:
 | Thank you, Marcin. 
 | 
 | Your reply seems to imply that the structure
 | of the program I posted was basically OK?

Another way appears as an example in Tackling The Awkward Squad (in
the Using Asynchronous Exceptions section).  It's a bit more liberal
in its use of threads, doing forkIO twice within parIO, but the
overall effect is pretty similar to your function's.

timeout :: Int -> IO a -> IO (Maybe a)
timeout n a = parIO (do { r <- a; return (Just r) })
(do { threadDelay n; return Nothing })

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users