Re: [Haskell-cafe] space leak with 'concat' ?

2009-01-27 Thread Sterling Clover
Note that only monomorphic declarations are CAFed. If you have an explicit polymorphic signature, it will be treated as a function and garbage-collected as usual. So if you have, e.g., a list of Doubles, declaring it as foo :: Num a => [a] would do the trick. Cheers, S. On Tue, Jan 27, 2009 at 6:2

Re: [Haskell-cafe] space leak with 'concat' ?

2009-01-27 Thread Jake McArthur
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Henning Thielemann wrote: | in that module I defined the text to be printed as top-level | variable which might have been the problem. But this can't be the | problem of the compiled version of the program, where I encountered the | leak. So I have to

Re: [Haskell-cafe] space leak with 'concat' ?

2009-01-27 Thread Henning Thielemann
On Tue, 27 Jan 2009, Henning Thielemann wrote: On Tue, 27 Jan 2009, Jonathan Cast wrote: To show that there's nothing wrong with concat per se, try this version instead: ghc +RTS -M16m -c30 -RTS -e 'print $ concat $ repeat "bla"' This should print forever without any problems. You are

Re: [Haskell-cafe] space leak with 'concat' ?

2009-01-27 Thread Henning Thielemann
On Tue, 27 Jan 2009, Jonathan Cast wrote: To show that there's nothing wrong with concat per se, try this version instead: ghc +RTS -M16m -c30 -RTS -e 'print $ concat $ repeat "bla"' This should print forever without any problems. You are right, this works. My example was extracted from a

Re: [Haskell-cafe] space leak with 'concat' ?

2009-01-27 Thread Jonathan Cast
On Tue, 2009-01-27 at 22:12 +0100, Henning Thielemann wrote: > $ ghc +RTS -M16m -c30 -RTS -e 'concat $ repeat "bla"' > > This breaks down after a while, also if I increase the memory restriction: > > ... > ablablablablablablablablablablablablablablablablablablablablablaHeap > exhausted; > Curren

[Haskell-cafe] space leak with 'concat' ?

2009-01-27 Thread Henning Thielemann
$ ghc +RTS -M16m -c30 -RTS -e 'concat $ repeat "bla"' This breaks down after a while, also if I increase the memory restriction: ... ablablablablablablablablablablablablablablablablablablablablablaHeap exhausted; Current maximum heap size is 15998976 bytes (15 Mb); use `+RTS -M' to increase it.