Is there a function in Haskell like say:
max_of_type :: (Num a) => a
So:
max_of_type :: Int == 2 ^ 31 - 1 // for example, implementation dependent
Yes, it's called maxBound.
There is also minBound. They are both part of the Bounded type class.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With