Haskell 中是否有这样的功能:
max_of_type :: (Num a) => a
所以:
max_of_type :: Int == 2 ^ 31 - 1 // for example, implementation dependent
最佳答案
是的,它叫做maxBound
。
还有minBound
。它们都是 Bounded
类型类的一部分。
关于Haskell:最大/最小函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10876723/