[Haskell-beginners] Further constraining types

David Virebayre dav.vire+haskell at gmail.com
Fri Aug 5 09:44:48 CEST 2011


2011/8/5 Arlen Cuss <celtic at sairyx.org>:
>> I would go with :
>>  validatePositive :: Int -> Maybe (Positive Int)
>>  square :: Positive Int -> Positive Int
>
> But squaring a negative Int is still guaranteed to be positive!

I thought he said he wanted to work with natural numbers.

David.



More information about the Beginners mailing list