Skip to content

all isDigit "" evaluates to True. Should it not evaluate to False?

Summary

import Data.Char (or  :m +Data.Char  if in GHCi)

all isDigit ""

evaluates to True. Should it not evaluate to False?

import Data.Char (or :m +Data.Char if in GHCi)

all isDigit ""

evaluates to True. Should it not evaluate to False? For example, in ghci:

Prelude> :m +Data.Char
Prelude Data.Char> all isDigit ""
True

Steps to reproduce

See above.

Please provide a set of concrete steps to reproduce the issue.

Launch Terminal utility on MacOS 10.14.5.

$ ghci
GHCi, version 8.2.1: http://www.haskell.org/ghc/  :? for help
...
Prelude> :m +Data.Char
Prelude Data.Char> all isDigit ""
True

Expected behavior

What do you expect the reproducer described above to do?

Evaluate to False, I believe.

Environment

  • GHC version used: 8.2.1 on MacOS 10.14.5, Mojave

Optional:

  • Operating System: MacOS 10.14.5, Mojave
  • System Architecture: Desktop Mac, in Terminal utility
Edited by Ben Gamari
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information