aiken/examples/acceptance_tests/038/lib/tests.ak

22 lines
288 B
Plaintext

pub fn and(self: List<Bool>) -> Bool {
when self is {
[] -> True
[x, ..xs] -> x && and(xs)
}
}
test and_1() {
and([True, True])
}
pub fn or(self: List<Bool>) -> Bool {
when self is {
[] -> False
[x, ..xs] -> x || or(xs)
}
}
test or_1() {
or([True, True])
}