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
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
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,
| 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
| 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
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
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
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)
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
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
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
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.
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
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
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
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
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
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
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.
19 matches
Mail list logo