External Core bug: Illegal data constructor name

2003-03-10 Thread Kirsten Chevalier
If you compile the lambda nofib benchmark with -fext-core, GHC won't compile the resulting .hcr file: [EMAIL PROTECTED] lambda]$ ghc -fext-core Main.hs [EMAIL PROTECTED] lambda]$ ghc Main.hcr Illegal data constructor name `Main.StateMonad2' This is using GHC 5.05. -- Kirsten Chevalier *

Re: Effect of large binaries on garbage collection

2003-03-10 Thread Adrian Hey
On Thursday 06 March 2003 10:55, Adrian Hey wrote: On Tuesday 04 March 2003 12:36, Simon Peyton-Jones wrote: GHC does not copy big objects, so don't worry about the copying cost. (Instead of copying, it allocates big objects to (a contiguous series of) heap blocks, with no other objects in

RE: Effect of large binaries on garbage collection

2003-03-10 Thread Simon Marlow
Thanks, looks like it's option (1) then. Could you tell me what Haskell type I have to use be able to pass a pointer to this binary to C land (genuine address, not StablePtr). I don't think the standard FFI allows this at all but, IIRC, the old ghc libraries allowed you to do this with a

RE: Effect of large binaries on garbage collection

2003-03-10 Thread Simon Peyton-Jones
| In the current CVS GHC, undoubtedly the right thing to use is | Foreign.mallocForeignPtr. Internally these are implemented as | MutableByteArray#, so you get fast allocation and GC, but from the | programmer's point of view it's a normal ForeignPtr. I wonder how it is for a random FFI user to

Re: Type classes problem: Could not deduce ...

2003-03-10 Thread Matthias Neubauer
Hi Dirk, [EMAIL PROTECTED] writes: Hello, trying to compile the following program class ClassA a where foo :: a - Int class ClassA a = ClassB b a where toA :: b - a test :: (ClassB b a) = b - Int test x = let y = toA x in let z = foo y in

5.04.2 RPM Dependencies

2003-03-10 Thread Dominic Steinitz
Can anyone help? I downloaded the latest rpm for ghc but got the following errors on installation: error: failed dependencies: libc.so.6(GLIBC_2.3) is needed by ghc-5.04.2-1 libreadline.so.4 is needed by ghc-5.04.2-1 I guess I need to update libc and libreadline. Can anyone point me at the

Re: FFI Tutorial / Examples

2003-03-10 Thread Daan Leijen
On Sun, 09 Mar 2003 22:13:35 -0500, Matthew Donadio [EMAIL PROTECTED] wrote: I may be being a bit dense about this, but I am having some trouble understanding how to use FFI, especially with respect to interfacing Haskell lists/arrays to C arrays. For example, say I have the C functions void foo

Re: palm?

2003-03-10 Thread Bjorn Lisper
M. Parker: What about a port to Windows CE (i.e., for Pocket PC's). Or even better yet, hugs for Pocket PC! -Matt There is an interesting research question in here: how to design lean implementations of lazy functional languages so they can run on small handheld and embedded systems with

Re: palm?

2003-03-10 Thread Jerzy Karczmarczuk
Bjorn Lisper wrote: There is an interesting research question in here: how to design lean implementations of lazy functional languages so they can run on small handheld and embedded systems with restricted resources. In particular the restricted memory available poses an interesting challenge.

Re: palm?

2003-03-10 Thread Pertti Kellomäki
Bjorn Lisper wrote: There is an interesting research question in here: how to design lean implementations of lazy functional languages so they can run on small handheld and embedded systems with restricted resources. [...] Furthermore, the i/o model must be developed to accomodate the

Re: palm?

2003-03-10 Thread Bjorn Lisper
Just a side remark. I wonder whether the byte-code approach is the best possible solution taking into account the overload of the decoder. Why not threaded code? The FORTH (and similar) experience, PostScript implementations, etc. show that this paradigm may be more interesting. Anyway, when you

Re: palm?

2003-03-10 Thread Karl-Filip Faxen
Wait a minute! As far as I have understood, threaded refers (in this context) to a style of writing (byte code) interpreters. A threaded interpreter does not have a dispatch loop which reads the next byte code and then invokes the correct handler (typically by using the byte code as an index

Postdoc PhD positions in Datatype-Generic programming

2003-03-10 Thread Jeremy Gibbons
[We apologize if you receive multiple copies of this announcement.] Postdoctoral research fellow (University of Nottingham) Doctoral studentship (University of Oxford) in DATATYPE-GENERIC PROGRAMMING The Universities of Nottingham and Oxford have positions available to work on an EPSRC-supported

Help on handles

2003-03-10 Thread Yeo Gek Hui
Hi, Has anyone have experience reading from a handle using hGetContents when the handle is still open and receives input from outside? I need to do some manipulation to the contents and I can't afford to close this handle. for example, an infinite stream abcabc... is written from outside to this

polymorphic type in state of state monad

2003-03-10 Thread Wang Meng
Hi All, Any one of your have the experience of defining a state of a state monad as a polymorphic type? I want to have: type State = Term a = [a] data M a = M (State - IO(State,a)) GHC yields a error message Illegal polymorphic type. How to resolve this? Thank you very much. -W-M- @ @

polymorphic type in state of state monad

2003-03-10 Thread Tom Pledger
Wang Meng writes: | Hi All, | | Any one of your have the experience of defining a state of a state monad | as a polymorphic type? | I want to have: | | type State = Term a = [a] | data M a = M (State - IO(State,a)) | | GHC yields a error message Illegal polymorphic type. | How to

Re: polymorphic type in state of state monad

2003-03-10 Thread Andrew J Bromage
G'day all. On Tue, Mar 11, 2003 at 08:34:06AM +1300, Tom Pledger wrote: If, on the other hand, you want to vary the state type *during* a single monadic computation, it gets messy. You could try one of the following. Very often, you just want to vary the state type for some portion of the

AADBUG 2003: Reminder

2003-03-10 Thread nilsson
Dear All, The deadline for submisson to AADEBUG'2003, the Fifth International Workshop on Automated and Algorithmic Debugging, is approaching. Papers and demos should be received by 22 March, 2003. Please find the CFP enclosed. See http://aadebug2003.elis.rug.ac.be/ for further details. Best

RE: GHC Error Message.

2003-03-10 Thread Simon Peyton-Jones
--- data AParser String = AP {apapply::([String]-[(String,[String])])} Whoa! You cant declare a data type like that! You must have a type variable after the data type name, thus:

Re: Alternatives to finalization

2003-03-10 Thread Alastair Reid
Nick Name [EMAIL PROTECTED] contemplates two ways of finalizing external resources: [lots of context deleted] f :: IO [a] f = do allocateResource l - makeTheStream addFinalizer l (disallocateResource) return l [snip] Another alternative is to make f return

Re: Alternatives to finalization

2003-03-10 Thread Manuel M T Chakravarty
Nick Name [EMAIL PROTECTED] wrote, As the result of a conversation on haskell-gui, I have tried to implement the disallocation of resources when a stream is garbage collected. To explain myself: I have a function f :: IO [a] which returns a lazy stream after allocating some

Re: Alternatives to finalization

2003-03-10 Thread John Meacham
another possibility is a withStream type function which explicitly finalizes. withStream :: Stream a - ([a] - IO b) - IO b the idea being the stream is freed when the IO b finishes. this can easily be built on your explicit 'close stream' version below, but may not be flexable enough for what