[Haskell-beginners] A Quantity Type - Integer without the Negative #'s

Ashok Gautham scriptdevil.haskell at gmail.com
Sat May 9 00:02:29 EDT 2009


On Sat, May 9, 2009 at 2:24 AM, Daniel Carrera
<daniel.carrera at theingots.org> wrote:
> That's an interesting question. I would like to see the answer too. I can
> think of a completely impractical way to do it:
>
> data Quantity = 0 | 1 | 2 | 3 | ... | 65532
>
>
> But of course, listing every integer seems like a dumb solution. But this
> gives me more confidence that there is a smart solution to your problem and
> we just need to find it.
>
> Daniel.

What about operators?

---
Ashok `ScriptDevil` Gautham


More information about the Beginners mailing list