Update generic syntax in tests.
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
pub fn foldr(xs: List(a), f: fn(a, b) -> b, zero: b) -> b {
|
||||
pub fn foldr(xs: List<a>, f: fn(a, b) -> b, zero: b) -> b {
|
||||
when xs is {
|
||||
[] -> zero
|
||||
[x, ..rest] -> f(x, foldr(rest, f, zero))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn prepend(x: a, xs: List(a)) -> List(a) {
|
||||
pub fn prepend(x: a, xs: List<a>) -> List<a> {
|
||||
[x, ..xs]
|
||||
}
|
||||
|
||||
pub fn concat(left: List(a), right: List(a)) -> List(a) {
|
||||
pub fn concat(left: List<a>, right: List<a>) -> List<a> {
|
||||
foldr(left, prepend, right)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user