> What is the matter with
>
> main =
> let xs =
> [((1,[0,0,0,0,2,0,0,0,0,2]),(-5,[0,0,0,0,1,0,3,3,0,1])),
> ((1,[0,1,0,0,0,1,0,0,0,1]),(-5,[0,1,0,0,0,1,0,0,0,1])),
> ((1,[0,1,0,0,1,0,0,0,0,2]),(-3,[0,1,0,0,1,0,0,-2,4,0])),
> ((1,[0,1,0,0,1,0,1,0,0,1]),(1,[0,1,0,0,1,-2,3,0,2,-1])),
> ((1,[0,1,0,0,1,0,2,0,1,0]),(3,[0,1,0,1,0,5,1,3,-3,2])),
> ((1,[0,2,0,0,0,0,0,0,0,2]),(-5,[0,1,0,3,0,0,0,3,0,1])),
> ((1,[0,2,0,0,0,0,1,0,0,1]),(-3,[0,0,4,-2,0,0,1,0,0,1])),
> ((1,[0,2,0,0,0,0,2,0,0,0]),(-5,[0,1,0,3,3,0,1,0,0,0])),
> ((1,[1,0,0,0,0,1,0,0,0,1]),(1,[1,0,0,0,1,0,0,-1,1,1])),
> ((1,[1,0,0,0,1,0,0,0,0,1]),(1,[1,0,0,0,1,-1,1,0,1,0])),
> ((1,[1,0,0,0,1,0,1,0,1,0]),(-5,[1,0,0,0,0,2,0,1,-1,1])),
> ((1,[1,0,0,1,1,0,0,0,1,0]),(-5,[1,0,0,1,0,2,-1,1,-1,1])),
> ((1,[1,0,1,0,0,0,0,0,0,1]),(1,[1,1,0,0,0,0,0,-1,1,1])),
> ((1,[1,0,1,0,0,0,1,0,0,0]),(1,[1,1,0,0,-1,1,1,0,0,0])),
> ((1,[1,1,0,0,0,0,0,0,0,1]),(1,[1,1,-1,1,0,0,0,0,1,0]))
> ]
> :: [((Int,[Int]), (Int,[Int]))]
> in
> putStr $ shows xs "\n"
hehe! Great bug report. I've filed this under "bugs that we knew about but
didn't think anyone would ever run into" :-)
A little calculation on the size of your data structure above:
Prelude> let cons=3; pair=3 in ((10*cons + pair) * 2 + pair) * 15 + 15 *
cons
1080
Prelude> let cons=3; pair=3 in ((10*cons + pair) * 2 + pair) * 14 + 14 *
cons
1008
Prelude>
The ints don't count, because we have a bunch of pre-allocated small
integers in the RTS which are used when possible. Ok, so with 15 elements,
your data structure needs 1080 words (or 4320 bytes). Removing one of the
elements, it only needs 1008 words (4032 bytes).
The size of a block in GHC's storage manageer? 4096 bytes. GHC doesn't
know how to allocate more than a block's worth of data except for things
like arrays and thread stacks, so it keeps trying to allocate 4320 bytes and
failing.
The reason it works with -O is because the whole structure gets pulled out
to the top level and made static :)
Thanks for the report. I suggest using -O in the meatime, while I think of
a good way to fix it.
Cheers,
Simon