Large lists, heaps, stacks...
Janis Voigtlaender
Janis Voigtlaender <voigt@orchid.inf.tu-dresden.de>
Fri, 19 Oct 2001 09:21:15 +0200 (MET DST)
Till Doerges writes:
> select' :: [a] -> [Integer] -> ([a],[a])
> select' xs poss = sAcc xs (sort poss) 0 ([],[])
> where sAcc :: [a] -> [Integer] -> Integer -> (([a],[a]) -> ([a],[a]))
> ...
>
> Crash> select' "test" [0..]
>
> (35922 reductions, 63905 cells)
> ERROR: Control stack overflow
> ...
>
> 2) Why does "select' "test" [0..]" not work?
>
You are trying to *sort* the *infinite* list poss=[0..].
--
Janis Voigtlaender
http://wwwtcs.inf.tu-dresden.de/~voigt/
mailto:voigt@tcs.inf.tu-dresden.de