Effect of large binaries on garbage collection

2003-03-04 Thread Adrian Hey
Hello, I'm writing a library which will require many blocks of binary data of various sizes (some very large) to be stored in the heap. I'm a little worried about the effect this will have on the efficiency of garbage collection. I'm not sure how ghc gc works these days, but I seem to remember

RE: Effect of large binaries on garbage collection

2003-03-04 Thread Simon Peyton-Jones
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 those blocks. Then the object can move simply by swizzling the heap-block descriptor.) Simon | -Original

Re: Stack profiling

2003-03-04 Thread Wolfgang Thaller
I had wanted to CC this to the list, but of course I forgot: Stephen Pitts [EMAIL PROTECTED] wrote: Is there an easy way to profile stack usage without rebuilding with ticky-ticky profiling? I have two implementations of an algorithm; the one with straight lists seems to use constant stack,

RE: First-class types

2003-03-04 Thread Simon Peyton-Jones
| The following is a more flexible alternative to overloading. We | essentially define a function on types and invoke it, seemingly at run | time. No Dynamics or unsafe computations are employed. We only need | existential types, multi-parameter classes and functional | dependencies. The code also

RE: fundeps for extended Monad definition

2003-03-04 Thread Simon Peyton-Jones
| I believe something along the lines of the following would work: | | class C a b | a - b where { foo :: b - String } | instance C Int Int where { foo x = show (x+1) } | x :: forall b. C Int b = b | x = 5 | | (Supposing that the above definition were valid; i.e., we didn't get the | type

RE: Persistent data

2003-03-04 Thread Simon Peyton-Jones
GHC has a multi-generational garbage collector. If you have enough physical memory on your machine so that the GC isn't thrashing trying to find the 100 free bytes that remain, then you should find the database migrates to the oldest generation and stays there. If you use +RTS -Sstderr you'll

Parsec: GHC /= Hugs?

2003-03-04 Thread Markus . Schnell
My program has a different behaviour under hugs and ghc. I wrote a very simple parser with Parsec and it parses a file quite easily - as long as I use hugs to run it. But when I compile it with ghc, the parse fails. (I'm currently working on WinNT with cygwin). Something else, but related: how

Re: First-class types

2003-03-04 Thread Jan-Willem Maessen
Simon PJ replies: Ingenious, but unnecessarily complicated. You don't need existential types at all. (See the code below, which is considerably simpler and, I fancy, a bit more efficient.) Also, I'm not sure why you make 'Type' (which is pretty much the Typable class in the Dynamic library)

Re: Tutorial for literate Haskell

2003-03-04 Thread Steffen Mazanek
Hi, When I ran into the same question some time ago I tried that, but found that the \verbatim was interpreted to0 literally, so that the \end{code} does not terminate it. Could you give a complete short example that works for you? My own solution was to copy the definition of verbatim

Re: Parsec: GHC /= Hugs?

2003-03-04 Thread Johannes Waldmann
On Tue, 4 Mar 2003 [EMAIL PROTECTED] wrote: My program has a different behaviour under hugs and ghc. I wrote a very simple parser with Parsec and it parses a file quite easily - I once got bitten by this: brackets is now called angles, while squares is now called brackets. see

big lambda in class declarations

2003-03-04 Thread Hal Daume III
So the word on the street is that allowing big lambda makes type inference undecidable. This makes sense to me since allowing big lambda essentially allows you to program at the type level and thus of course you'll get undecidability. However, I'm having difficulty understanding where the

Re: Parsec: GHC /= Hugs?

2003-03-04 Thread Iavor S. Diatchki
hi, [EMAIL PROTECTED] wrote: Something else, but related: how do I avoid writing different Code for Hugs and ghc? For example, I had to hide Word in Hugs with ... you are not allowed to hide things that are not exported. hugs erroneously used to export Word (and other stuff) from the prelude.

Persistant (as in on disk) data

2003-03-04 Thread Iavor S. Diatchki
hello, a recent post reminded me of a feature i'd like. for all i know it is already implemenetd in GHC so pointers are welcome. i'd like to be able to dump data structures to disk, and later load them. currently i do that with Show/Read but it is very slow and it seems as a kind of ovarloaded

compiling

2003-03-04 Thread Mike T. Machenry
I am having a problem compiling my code. Usually I run it with ghci -package data -fglashow-exts Main.hs Main declares a main function and imports all my other files. when I try to ghc it to compile I get that it can't find an interface file for each file in my project. How do I compile

Re: compiling

2003-03-04 Thread Matthew Donadio
Mike T. Machenry wrote: I am having a problem compiling my code. Usually I run it with ghci -package data -fglashow-exts Main.hs Main declares a main function and imports all my other files. when I try to ghc it to compile I get that it can't find an interface file for each file in my

Re: int to float problem

2003-03-04 Thread Andrew J Bromage
G'day all. On Mon, Mar 03, 2003 at 12:10:28PM -0500, Matthew Donadio wrote: This is my biggest gripe with Haskell, at least for what I do. The numeric class system is good, but it assumes that the sub-classes are distict, where in fact integers are a proper subset of reals, which are a

RE: Network module problem

2003-03-04 Thread Simon Marlow
Hello. I'm running into a problem with the Network module, which I suspect is pretty easy to fix, but am not sure how to best do so. The problem is that accept fails when the reverse DNS fails, with the following error: Fail: does not exist Action: getHostByAddr Reason: no such

Re: speedup help

2003-03-04 Thread Damien R. Sullivan
On Mon, Mar 03, 2003 at 08:46:22PM -0800, Mark P Jones wrote: pascal :: [[Integer]] pascal = iterate (\row - zipWith (+) ([0] ++ row) (row ++ [0])) [1] comb:: Int - Int - Integer comb n m = pascal !! n !! m In that case, you can take further advantage of using Pascal's triangle

Re: is identity the only polymorphic function without typeclasses?

2003-03-04 Thread Jay Cox
The time you grouped (a-b-c), you utilized the arrow type constructor to build a function type, it is no different that using a polymorphic list. I think I am not happy with the dual semantics of this arrow thingie. I have to ponder on this some more, I guess. Thanks for the response.