[Haskell-beginners] A Quantity Type - Integer without the Negative
#'s
aditya siram
aditya.siram at gmail.com
Fri May 8 14:22:23 EDT 2009
Hi all,
Is there a datatype in Haskell that can be used to represent only quantities
>= 0? I got bitten by a bug because I forgot to reject an amount that was
below zero after applying a decrementing operator. A simple unit test would
have caught this, but I was wondering if there was some way of getting the
type system to ensure this.
thanks ...
-deech
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/beginners/attachments/20090508/0a0a5703/attachment.htm
More information about the Beginners
mailing list