[Haskell-beginners] Further constraining types

Arlen Cuss celtic at sairyx.org
Fri Aug 5 09:22:09 CEST 2011


> 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!



More information about the Beginners mailing list