What would these types be used for? If your students are complaining
about having to perform logarithms to store integers, inform them of
the "Integer" type.

The existing sized types -- Word/Int [8, 16, 32, 64] -- are useful
primarily because they match up with "standard" integral data types in
other languages. They're great for FFI, (un)marshaling via ByteString,
and occasional low-level code.

In contrast, there is (to my knowledge) no machine with 42-bit
integers, so there's no point to defining such intermediate types.

In your FileSize example, it would be much easier to simply use:

newtype FileSize = FileSize Integer

since then your code will cope nicely when everybody upgrades to PB
disks in a few years. If you need particular bounds, create your own
instance of Bounded.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to