> いずれにしても :set +s で、実行結果が 0byte と出るので
> 一時的なリストは生成されていないはずですよね。
> 
> On Thu, 20 Mar 2003 10:27:50 +0900
> Shinya Hayakawa <tetryl / tokyoprogrammer.com> wrote:
> > ghci で実行してみたら以下のような結果になりました。
> > これは reverse を使っても全リストを溜め込まないという
> > ことでしょうか??

??
ghci の byte 表示はなにをあらわしているのかよくわからないですねぇ。
ちょっと冗長ですが hugs の例をあげておきます。

-- Reverse version ---------------------------
Main> rtailn 3 [1..10]
[8,9,10]
(332 reductions, 587 cells)
Elapsed time (ms): 90 (user), 0 (system)
Main> rtailn 3 [1..20]
[18,19,20]
(512 reductions, 772 cells)
Elapsed time (ms): 100 (user), 0 (system)
Main> rtailn 3 [1..50]
[48,49,50]
(1082 reductions, 1642 cells)
Elapsed time (ms): 90 (user), 0 (system)
Main> rtailn 3 [1..100]
[98,99,100]
(2032 reductions, 3093 cells)
Elapsed time (ms): 100 (user), 0 (system)
Main> ttailn 3 [1..10]
[8,9,10]
(307 reductions, 433 cells)
Elapsed time (ms): 90 (user), 0 (system)

-- Toyofuku version ------------------------
Main> ttailn 3 [1..20]
[18,19,20]
(497 reductions, 705 cells)
Elapsed time (ms): 100 (user), 0 (system)
Main> ttailn 3 [1..50]
[48,49,50]
(1067 reductions, 1515 cells)
Elapsed time (ms): 100 (user), 0 (system)
Main> ttailn 3 [1..100]
[98,99,100]
(2017 reductions, 2866 cells)
Elapsed time (ms): 100 (user), 0 (system)

-- Hayakawa version ------------------------
Main> htailn 3 [1..10]
[8,9,10]
(700 reductions, 876 cells)
Elapsed time (ms): 90 (user), 0 (system)
Main> htailn 3 [1..20]
[18,19,20]
(2082 reductions, 2504 cells)
Elapsed time (ms): 90 (user), 0 (system)
Main> htailn 3 [1..50]
[48,49,50]
(10437 reductions, 12194 cells)
Elapsed time (ms): 100 (user), 0 (system)
Main> htailn 3 [1..100]
[98,99,100]
(38362 reductions, 44345 cells)
Elapsed time (ms): 120 (user), 0 (system)

-- Improving value? version ----------------
Main> itailn 3 [1..10]
[8,9,10]
(610 reductions, 946 cells)
Elapsed time (ms): 90 (user), 0 (system)
Main> itailn 3 [1..20]
[18,19,20]
(1258 reductions, 1952 cells)
Elapsed time (ms): 90 (user), 0 (system)
Main> itailn 3 [1..50]
[48,49,50]
(3208 reductions, 4982 cells)
Elapsed time (ms): 100 (user), 0 (system)
Main> itailn 3 [1..100]
[98,99,100]
(6458 reductions, 10033 cells)
Elapsed time (ms): 90 (user), 0 (system)
Main> 

--
ML: haskell-jp / quickml.com
使い方: http://QuickML.com/