Skip to content

Strictness of span and break does not match documentation

The documentation of span says

span p xs is equivalent to (takeWhile p xs, dropWhile p xs)

However, that's not literally true since span p xs is | if either xs is | or xs = x :_ and p x is |.

This same error is also present in the Haskell 98 report, which states the same property of span but gives a definition equivalent to the one used by GHC.

Trac metadata
Trac field Value
Version 8.0.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component libraries/base
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information