fix typo in filter
This commit is contained in:
parent
1c650cf1bb
commit
71b139c048
|
@ -261,7 +261,7 @@ fn map {
|
||||||
fn filter {
|
fn filter {
|
||||||
"Takes a list and a predicate function, and returns a new list with only the items that produce truthy values when the function is called on them. E.g., `filter ([1, 2, 3, 4], odd?) &=> [1, 3]`. Also works on sets."
|
"Takes a list and a predicate function, and returns a new list with only the items that produce truthy values when the function is called on them. E.g., `filter ([1, 2, 3, 4], odd?) &=> [1, 3]`. Also works on sets."
|
||||||
(p? as :fn) -> filter(p?, _)
|
(p? as :fn) -> filter(p?, _)
|
||||||
(p? as :fn, xs as list) -> {
|
(p? as :fn, xs as :list) -> {
|
||||||
fn filterer (filtered, x) -> if p? (x)
|
fn filterer (filtered, x) -> if p? (x)
|
||||||
then append (filtered, x)
|
then append (filtered, x)
|
||||||
else filtered
|
else filtered
|
||||||
|
|
Loading…
Reference in New Issue
Block a user