gpt4 book ai didi

Haskell:最大/最小函数

转载 作者:行者123 更新时间:2023-12-01 08:35:41 27 4
gpt4 key购买 nike

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/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com