On Thu, Mar 13, 2008 at 4:50 PM, Krzysztof Kościuszkiewicz
<[EMAIL PROTECTED]> wrote:
> Retainers are thunks or objects on stack that keep references to
> live objects. All retainers of an object are called the object's
> retainer set. Now when one makes a profiling run, say with ./jobname
> +
On Wed, Mar 12, 2008 at 12:34:38PM -0700, Justin Bailey wrote:
> The stack blows up when a bunch of unevaluated thunks build up, and
> you try to evaluate them. One way to determine where those thunks are
> getting built is to use GHCs "retainer" profiling. Retainer sets will
> show you the "call
On Thu, Mar 13, 2008 at 05:52:05PM +0100, Bertram Felgenhauer wrote:
> > ... Now evaluation of the parser state blows the stack...
> >
> > The code is at http://hpaste.org/6310
>
> Apparently, stUpdate is too lazy. I'd define
>
> stUpdate' :: (s -> s) -> Parser s t ()
> stUpdate' f = st
Krzysztof Kościuszkiewicz wrote:
> I have tried both Poly.StateLazy and Poly.State and they work quite well
> - at least the space leak is eliminated. Now evaluation of the parser
> state blows the stack...
>
> The code is at http://hpaste.org/6310
Apparently, stUpdate is too lazy. I'd define
On Wed, Mar 12, 2008 at 12:12 PM, Krzysztof Kościuszkiewicz
<[EMAIL PROTECTED]> wrote:
> I have tried both Poly.StateLazy and Poly.State and they work quite well
> - at least the space leak is eliminated. Now evaluation of the parser
> state blows the stack...
>
> The code is at http://hpaste.o
On Mon, Mar 03, 2008 at 05:20:09AM +0100, Bertram Felgenhauer wrote:
> > Another story from an (almost) happy Haskell user that finds himself
> > overwhelmed by laziness/space leaks.
> >
> > I'm trying to parse a large file (>600MB) with a single S-expression
> > like structure. With the help of
Krzysztof Kościuszkiewicz wrote:
> Another story from an (almost) happy Haskell user that finds himself
> overwhelmed by laziness/space leaks.
>
> I'm trying to parse a large file (>600MB) with a single S-expression
> like structure. With the help of ByteStrings I'm down to 4min processing
> time
On Mon, Mar 3, 2008 at 2:23 AM, Krzysztof Kościuszkiewicz
<[EMAIL PROTECTED]> wrote:
> Dear Haskellers,
>
> Another story from an (almost) happy Haskell user that finds himself
> overwhelmed by laziness/space leaks.
>
> I'm trying to parse a large file (>600MB) with a single S-expression
> like
Dear Haskellers,
Another story from an (almost) happy Haskell user that finds himself
overwhelmed by laziness/space leaks.
I'm trying to parse a large file (>600MB) with a single S-expression
like structure. With the help of ByteStrings I'm down to 4min processing
time in constant space. However,
>
> > \begin{code}
> > catWithLen :: [a] -> (Int -> [a]) -> [a]
> > catWithLen xs f = h 0 xs
> > where
> > h k [] = f k
> > h k (x : xs) = case succ k of-- forcing evaluation
> > k' -> x : h k' xs
> > \end{code}
> >
>
> Thanks but this gives
On Sun, Feb 04, 2007 at 09:45:12AM +, Dominic Steinitz wrote:
> > pad :: Num a => [a] -> [a]
> > pad = pad' 0
> > where pad' l [] | l `seq` False = undefined
Stupid typo, that should be:
where pad' l _ | l `seq` False = undefined
> > pad' l [] = [0x80] ++ ps ++ lb
> > w
On Sunday 04 February 2007 08:28, Stefan O'Rear wrote:
> On Sun, Feb 04, 2007 at 08:20:23AM +, Dominic Steinitz wrote:
> > Someone suggested
> >
> > pad :: Num a => [a] -> [a]
> > pad = pad' 0
> > where pad' !l [] = [0x80] ++ ps ++ lb
> > where pl = (64-(l+9)) `mod` 64
> >
On Sun, Feb 04, 2007 at 08:30:44AM +, Dominic Steinitz wrote:
> On Saturday 03 February 2007 19:42, [EMAIL PROTECTED] wrote:
> > I would try something along the following lines (untested):
> >
> > \begin{spec}
> > catWithLen xs f = xs ++ f (length xs)
> > \end{spec}
> >
> > \begin{code}
> > cat
On Saturday 03 February 2007 19:42, [EMAIL PROTECTED] wrote:
> > I have re-written SHA1 so that is more idiomatically haskell and it is
> > easy to see how it implements the specification. The only problem is I
> > now have a space leak. I can see where the leak is but I'm less sure
> > what to
On Sun, Feb 04, 2007 at 08:20:23AM +, Dominic Steinitz wrote:
> Someone suggested
>
> pad :: Num a => [a] -> [a]
> pad = pad' 0
> where pad' !l [] = [0x80] ++ ps ++ lb
> where pl = (64-(l+9)) `mod` 64
> ps = replicate pl 0x00
> lb = i2osp 8 (8*l)
>
On Saturday 03 February 2007 19:56, Pepe Iborra wrote:
> pad :: [Word8] -> [Word8]
> pad xs = pad' xs 0
>
> pad' (x:xs) l = x : pad' xs (succ l)
> pad' [] l = [0x80] ++ ps ++ lb
> where
> pl = (64-(l+9)) `mod` 64
> ps = replicate pl 0x00
> lb = i2osp 8 (8*l)
Pepe,
Thanks b
hi Dominic
Explicit recursion works just fine for me and keeps things simple:
pad :: [Word8] -> [Word8]
pad xs = pad' xs 0
pad' (x:xs) l = x : pad' xs (succ l)
pad' [] l = [0x80] ++ ps ++ lb
where
pl = (64-(l+9)) `mod` 64
ps = replicate pl 0x00
lb = i2osp 8 (8*l)
at the c
>
> I have re-written SHA1 so that is more idiomatically haskell and it is easy
> to
> see how it implements the specification. The only problem is I now have a
> space leak. I can see where the leak is but I'm less sure what to do about
> getting rid of it.
>
> Here's the offending f
I have re-written SHA1 so that is more idiomatically haskell and it is easy to
see how it implements the specification. The only problem is I now have a
space leak. I can see where the leak is but I'm less sure what to do about
getting rid of it.
Here's the offending function:
pad :: [Word8] -
19 matches
Mail list logo