Generally Haskell libraries make a point of making impossible states unrepresentable in the types. But I often see Int
used where only a non-negative number makes sense. Why is Word
not used in those cases?
Asked
Active
Viewed 5,069 times
18

user2141650
- 2,827
- 1
- 15
- 23
-
This question, though very interesting, is likely to have just subjective answers. As such, it does not meet the SO requirements. – jakubdaniel Sep 21 '15 at 15:22
-
1Previously asked: http://stackoverflow.com/questions/12432154/int-vs-word-in-common-use – Michael Benfield Sep 21 '15 at 15:44
1 Answers
21
We only just now got Numeric.Natural
in base
, too.
I think it is just historical accident. Int
and Integer
were in the haskell 98 prelude, which didn't get bogged down with lots of other fixed-size integer types.

Doug McClean
- 14,265
- 6
- 48
- 70