8
|
Nathan Shively-Sanders · 技术社区 · 15 年前 |
1
13
ghci> :m Control.Monad ghci> :t liftM2 (&&) liftM2 (&&) :: (Monad m) => m Bool -> m Bool -> m Bool ghci> liftM2 (&&) (5 <) (< 10) 8 True
你也可以这样做
ghci> :t (. flip ($)) . flip all (. flip ($)) . flip all :: [a -> Bool] -> a -> Bool ghci> :t (. flip ($)) . flip any (. flip ($)) . flip any :: [a -> Bool] -> a -> Bool |
2
6
它不是内置的,但我更喜欢使用类型类来 对任意算术谓词的布尔运算:
我爱哈斯克尔! |
3
1
|
tender · 基于布尔限定符的Python熊猫if语句 6 年前 |
user3663055 · 尽管有适当的布尔值,但代码不会打印 6 年前 |
merko · 检查布尔值-Javascript 6 年前 |
user6631314 · IOS/核心数据/目标-C:使用布尔值预测 6 年前 |
user1032531 · 符号极性的自然键 6 年前 |
Bartholomas · Python语句中的布尔逻辑 6 年前 |
Dustin Michels · 理解字符串的真实性 6 年前 |
user44840 · 熊猫数据帧阈值--如果超过,则保持数字固定 6 年前 |