Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is unsigned int so rare in haskell? [duplicate]

Tags:

haskell

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?

like image 540
user2141650 Avatar asked Sep 21 '15 15:09

user2141650


1 Answers

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.

like image 153
Doug McClean Avatar answered Sep 25 '22 08:09

Doug McClean