Re: greencard bug

2001-11-24 Thread Sigbjorn Finne

Hi,

you don't say how you processed that example .gc file with GreenCard,
but I'm guessing you used the '--target ghc' option. If that's the case,
have
a look at

  http://www.haskell.org/greencard/type-sig.html#SEC-BODY

which discusses safe vs. unsafe calls -- i.e., in your case you need to
change
the %code below to %safecode. (Alternatively, use the -S option).

hth
--sigbjorn

- Original Message -
From: Chen Yu [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, November 22, 2001 03:42
Subject: greencard bug


 Hi, there
I am using Greencard with Hask's foreign function export. I found
 the following program can cause seg-fault. Anyone has any idea? BTW,
 if I replace greencard with Hask's foreign function import, there
 is no such error.

 in ABC.gc:

 foreign export ccall h_add h_add :: Int - IO Int
 h_add a = do
 putStrLn in haskell callback
 return (a + 1)

 %fun add ::  Int - IO(Int)
 %call (int a)
 %code int r;
 % r = c_add (a);
 %result (int r)

 and the result is like:

 in c callback
 in haskell callback
 Segmentation Fault




 in add.c:

 _RESULT c_add(int a) {
 printf(in c callback\n);
 return h_add(a);
 }


 TIA!

 --
 chenyu
 in Main.hs:

 main = do
 a - add 127
 putStrLn (show a)




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



Functional Metapost revival

2001-11-24 Thread Ferenc Wagner

You can find a version of Functional Metapost, which works
with current (2001 February) Hugs, on the following page:

http://afavant.elte.hu/~wferi/funcmp/

This version is able to produce all the illustrations in the
enclosed Tutorial on my machine.

  Good luck, waiting for your comments: Feri.

___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell



Re: heap and walking through a very long list

2001-11-24 Thread Joe English


Simon Peyton-Jones wrote:

 There should really be a strict accumArray, just as there
 should be a strict foldl.

Yes, please!

Is there a way to write a strict version of accumArray in
Haskell 98, or does this need to be done by the implementation?


--Joe English

  [EMAIL PROTECTED]

___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell