ForeignPtr's - why can't they be passed directly to foreign functions?

2006-03-15 Thread Brian Hulley
Hi - I've got the beginnings of an API for a GUI system as follows: data DWindow a data DEdit a type Window = DWindow type Edit a = DWindow (DEdit a) foreign import ccall duma_init :: IO () foreign import ccall duma_run :: IO () foreign import ccall duma_release :: FunPtr (Ptr (Window a) -> IO

Re: ForeignPtr's - why can't they be passed directly to foreign functions?

2006-03-15 Thread Esa Ilari Vuokko
On 3/15/06, Brian Hulley <[EMAIL PROTECTED]> wrote: > Hi - > I've got the beginnings of an API for a GUI system as follows: > > data DWindow a > data DEdit a > > type Window = DWindow > type Edit a = DWindow (DEdit a) > > foreign import ccall duma_init :: IO () > foreign import ccall duma_run :: IO

Re: ForeignPtr's - why can't they be passed directly to foreign functions?

2006-03-15 Thread kahl
Brian Hulley <[EMAIL PROTECTED]> wrote: > My other question is what happens if I want to have a function that takes > more than one ForeignPtr as argument ie > > foreign import ccall duma_test :: Ptr (Window a) -> Ptr (Window a) -> IO () > > test :: ForeignPtr (Window a) -> ForeignPtr (W

Re: ForeignPtr's - why can't they be passed directly to foreign functions?

2006-03-15 Thread Simon Marlow
Brian Hulley wrote: I've got the beginnings of an API for a GUI system as follows: ... addTop :: ForeignPtr (Window a) -> IO () addTop w = withForeignPtr w duma_addTop This works, but it seems a bit of a pain to have to manually convert between ForeignPtr's and Ptr's all the time. In partic

6.4.2 release plans

2006-03-15 Thread Simon Marlow
Hi Folks, This is a heads up for the forthcoming 6.4.2 release. Our rough timescale is to go into release candidate testing in about a week, and have two weeks of release candidates before the final release. Here are the things we know about and plan to fix before the release: http://hackag

Re: ForeignPtr's - why can't they be passed directly to foreign functions?

2006-03-15 Thread Brian Hulley
Esa Ilari Vuokko wrote: On 3/15/06, Brian Hulley <[EMAIL PROTECTED]> wrote: [snip] (Not directly related, but maybe useful to know) Stricly speaking, asynchronous exception may occur in between, and this code should in fact be "surrounded" by block to prevent resource leaks. createEdit = bloc

Mixing registerised and unregisterised builds

2006-03-15 Thread Ian Lynagh
Hi all, The attached e-mail seems to be about a problem using a library compiled with an unregisterised ghc with a registerised ghc. The linking step is giving many "undefined reference to `stg_ap_p_ret'"s (with various numbers of 'p's) as well as a few to `GHCziIOBase_zdWIO_entry', and possible

Re: ForeignPtr's - why can't they be passed directly to foreignfunctions?

2006-03-15 Thread Brian Hulley
[EMAIL PROTECTED] wrote: Brian Hulley <[EMAIL PROTECTED]> wrote: My other question is what happens if I want to have a function that takes more than one ForeignPtr as argument ie foreign import ccall duma_test :: Ptr (Window a) -> Ptr (Window a) -> IO () test :: ForeignPtr (Window a) -> Forei

Re: 6.4.2 release plans

2006-03-15 Thread Duncan Coutts
On Wed, 2006-03-15 at 16:24 +, Simon Marlow wrote: > Hi Folks, > > This is a heads up for the forthcoming 6.4.2 release. Our rough > timescale is to go into release candidate testing in about a week, and > have two weeks of release candidates before the final release. > > Here are the thin

Re: ForeignPtr's - why can't they be passed directly to foreign functions?

2006-03-15 Thread Brian Hulley
Simon Marlow wrote: Brian Hulley wrote: I've got the beginnings of an API for a GUI system as follows: ... addTop :: ForeignPtr (Window a) -> IO () addTop w = withForeignPtr w duma_addTop This works, but it seems a bit of a pain to have to manually convert between ForeignPtr's and Ptr's all

Re: ForeignPtr's - why can't they be passed directly to foreignfunctions?

2006-03-15 Thread Brian Hulley
Brian Hulley wrote: Hi - I've got the beginnings of an API for a GUI system as follows: foreign import ccall duma_createEdit :: IO (Ptr (Edit a)) createEdit :: IO (ForeignPtr (Edit a)) These should of course be: foreign import ccall duma_createEdit :: IO (Ptr (Edit ())) and crea

Re: ForeignPtr's - why can't they be passed directly to foreign functions?

2006-03-15 Thread Duncan Coutts
On Wed, 2006-03-15 at 17:01 +, Brian Hulley wrote: > Simon Marlow wrote: > > This is the way it used to be in GHC before the FFI. In the FFI we > > moved to withForeignPtr instead. IIRC, the motivation was something > > along these lines: > > > > - allowing ForeignPtr to be passed directly

Re: 6.4.2 release plans

2006-03-15 Thread Michael Marte
Simon Marlow wrote: Hi Folks, This is a heads up for the forthcoming 6.4.2 release. Our rough timescale is to go into release candidate testing in about a week, and have two weeks of release candidates before the final release. Here are the things we know about and plan to fix before the r

newbie: building ghc

2006-03-15 Thread Mark Greenbank
Hi, Sorry for the newbie question ... I'm trying to build the compiler and I'm getting the following error: [EMAIL PROTECTED] ghc-6.4.1]# ./configure --prefix=/usr/pkg checking build system type... i386-pc-solaris2.10 checking host system type... i386-pc-solaris2.10 checking target system type...

Re: newbie: building ghc

2006-03-15 Thread Duncan Coutts
On Wed, 2006-03-15 at 17:22 -0500, Mark Greenbank wrote: > Hi, > > Sorry for the newbie question ... I'm trying to build the compiler and > I'm getting the following error: > > [EMAIL PROTECTED] ghc-6.4.1]# ./configure --prefix=/usr/pkg > checking build system type... i386-pc-solaris2.10 > checki

Re: ghc releasing memory during compilation

2006-03-15 Thread John Meacham
On Mon, Mar 13, 2006 at 04:06:59PM +0300, Bulat Ziganshin wrote: > SM> I think what you're suggesting is that the runtime should detect the > SM> amount of physical memory on the system and auto-tune itself to switch > SM> to compacting collection when its residency reaches that amount. This > SM