logo       

arithmetic sequences and the prelude: minor problems?: msg#00135

lang.haskell.glasgow.bugs

Subject: arithmetic sequences and the prelude: minor problems?

Hi,

Haskell Report 6.3.4, pg 86-87, talks about arithmetic sequences.

For all four of these Prelude numeric types, all of the enumFrom family of functions are strict in all their arguments.

This seems to imply that for other Prelude types, functions of the enumFrom family aren't. Yet,

bot :: Bool -> Bool
bot x = bot x

take 1 [False .. bot True]

doesn't terminate.

Possible solution, rewording: For all Prelude types, all of the enumFrom family of functions are strict in all their arguments.

Incidentally, [1..5] is accepted (no space between 1 and the dots), while [False..True] is not (no spaces after False), which appears to be a parsing inconsistency. All this with, ghc-6.4.2 recent snapshots (and also in 6.4). As for the upper limit, spaces or not are both OK.

Share and enjoy.
Laszlo


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise