【发布时间】:2014-09-18 19:31:41
【问题描述】:
在 haskell 中,可以这样写:
containsTen::Num a => Eq a => [a] -> Bool
containsTen (x : y : xs)
| x + y == 10 = True
| otherwise = False
是否可以在 Idris 中编写等价的东西,而无需使用 ifThenElse(我的实际情况比上述情况更复杂)?
【问题讨论】:
标签: syntax pattern-matching idris guard-clause