On 3/24/06, Henning Thielemann <[EMAIL PROTECTED]> wrote:
> A new type, say Cardinal as in Modula, would document for the user of a
> function that only non-negative numbers are allowed and the function
> writer can be sure, that only non-negative numbers are passed.
>
> ...
>
>   newtype Cardinal = Cardinal Integer deriving (Show, Read, Eq, Ord, Ix)
>   newtype Card     = Card     Int     deriving (Show, Read, Eq, Ord, Ix)

Has anybody tried to implement arbitrary- and machine-size natural
numbers (Cardinal and Card, respectively) in GHC using unboxed types?
It should be just a matter of tweaking Int, Integer and Word a bit.
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to