This repository has been archived by the owner on Sep 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set filter and map to use build in funcs
- Loading branch information
Showing
2 changed files
with
8 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
from pyramda.function.curry import curry | ||
from builtins import filter as uncurried_filter | ||
|
||
|
||
filter = curry(lambda p, xs: [x for x in xs if p(x)]) | ||
@curry | ||
def filter(p, xs): | ||
return list(uncurried_filter(p, xs)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
from pyramda.function.curry import curry | ||
from builtins import map as uncurried_map | ||
|
||
|
||
map = curry(lambda f, xs: [f(x) for x in xs]) | ||
@curry | ||
def map(f, xs): | ||
return list(uncurried_map(f, xs)) |