arithmetic sequences and the prelude: minor problems?

Laszlo Nemeth lnemeth at cs.bilgi.edu.tr
Fri Jun 30 06:00:53 EDT 2006


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



More information about the Glasgow-haskell-bugs mailing list