
Hi, I believe, without checking, that Am Sonntag, den 24.02.2013, 17:49 +0000 schrieb Tom Ellis:
many :: () -> [Int] many () = [1..million]
is indeed called many times. The problem is that [1..million] is not dependent on the parameter, so GHC will float it out to a top level declaration, and hence share it between the multiple calls to many. You should try:
million :: () -> Int million _ = 10 ^ (6 :: Int)
many :: () -> [Int] many x = [1..million x]
Greetings, Joachim (Maybe I should continue to work on http://arxiv.org/abs/1106.3478 and related ideas, like annotating thunks in the code as unshareable... or does this mostly occur in small example programs like this?) -- Joachim "nomeata" Breitner Debian Developer nomeata@debian.org | ICQ# 74513189 | GPG-Keyid: 4743206C JID: nomeata@joachim-breitner.de | http://people.debian.org/~nomeata