Skip to content

missing empty-Enumeration and out-of-range warning for `Natural`

GHCi, version 7.10.2: http://www.haskell.org/ghc/  :? for help
λ:2> :set -XNegativeLiterals 
λ:3> (-123) :: Word

<interactive>:3:2: Warning: Literal -123 is out of the Word range 0..18446744073709551615
18446744073709551493
it :: Word

λ:4> (-123) :: Numeric.Natural.Natural
*** Exception: arithmetic underflow

λ:5>
λ:6> [10..3] :: [Word]
<interactive>:6:1: Warning: Enumeration is empty
[]
it :: [Word]

λ:7> [10..3] :: [Numeric.Natural.Natural]
[]
it :: [GHC.Natural.Natural]
Edited by Herbert Valerio Riedel
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information