gcc & GHC?

2001-07-26 Thread hooh pxw

h(eye), 

ghc for win32 isn't cool.
it remind me java in gcc 3.0.

is there any ghc project as gcc front-end?
then, we all happy on the technology of the GCC 3.0.

mercury, also the front end of the gcc. 

http://gcc.gnu.org/frontends.html


i am end user, so don't get me heavy/serious!
Ah! john backus's FP..

sorry for random/ugly keyboard typing!! 

__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

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



Re: wait(2)

2001-07-26 Thread Marcin 'Qrczak' Kowalczyk

Thu, 26 Jul 2001 16:44:57 +0200, George Russell <[EMAIL PROTECTED]> pisze:

> Is there a way in Glasgow Haskell to get a thread to wait on a
> child process in the same way as the Posix function wait(), and
> get the termination status of the child?

There is no easy way: all Haskell's thread run in the same process
and wait() blocks the whole process.

The only (or the only portable) way is to call wait() with WNOHANG
repeatedly in a thread and threadDelay for a short period of time
between calls.

This is what OCaml runtime does. It provides waiting for a process
as a threading primitive. It accounts for waiting in its select()
loop in the scheduler.

-- 
 __("<  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: wait(2)

2001-07-26 Thread Simon Marlow

> Is there a way in Glasgow Haskell to get a thread to wait on 
> a child process
> in the same way as the Posix function wait(), and get the 
> termination status
> of the child?  If so, how?

There's a couple of ways.  The obvious way is to get the thread to place
its result in an MVar when it exits: there's a guarantee that a thread
always either exits or raises an exception, so you can wrap the
top-level computation in something that places the result/exception in
an MVar.

Alternatively, you can foreign import rts_evalIO() and do it that way.
It ought to work, but I haven't tried it.  This way lets you get at the
Interrupted or Deadlocked return states too, which you can't do solely
within Haskell.

Hmm, now I think about it, the compiler won't let you foreign import
rts_evalIO() with the type you want, namely a -> Ptr b -> IO CInt, and
quite rightly so.  You'll need a version of rts_evalIO() that takes
StablePtrs instead.

Cheers,
Simon


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



Re: Rationals

2001-07-26 Thread Amanda Clare

I wrote: 
> The package "std" has a Ratio.hi in the lib/imports directory 
> (std isn't described in the documentation) but including this 
> doesn't help - same error

Oops, apologies, it turns out that this is correct for ghc, I just
didn't include it in all the files that needed it.

Amanda
--
Amanda Clare  http://users.aber.ac.uk/ajc99/
Tel: +44 (0)1970 621922  Fax: +44 (0)1970 622455
Dept. of Computer Science, University of Wales, Aberystwyth, SY23 3DB

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



Rationals

2001-07-26 Thread Amanda Clare

Does anyone know how I use Rationals in ghc? In nhc I can just write

let a = b % c 

But ghc-5.00.2 gives the error message "Variable not in scope: `%'"

I've looked through the documentation and can't find any reference to a
Rational library, or any other library that might have it. The package
"std" has a Ratio.hi in the lib/imports directory (std isn't described
in the documentation) but including this doesn't help - same error. 

The Haskell98 report says:
"In particular, the type Rational is a ratio of two Integer values, as
defined in the Rational library." 

Any ideas?

Amanda
--
Amanda Clare  http://users.aber.ac.uk/ajc99/
Tel: +44 (0)1970 621922  Fax: +44 (0)1970 622455
Dept. of Computer Science, University of Wales, Aberystwyth, SY23 3DB

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



wait(2)

2001-07-26 Thread George Russell

Is there a way in Glasgow Haskell to get a thread to wait on a child process
in the same way as the Posix function wait(), and get the termination status
of the child?  If so, how?

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