Skip to content
This repository has been archived by the owner on Sep 4, 2023. It is now read-only.

Commit

Permalink
Set filter and map to use build in funcs
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiors committed Sep 11, 2020
1 parent eaae4b8 commit 5bf2008
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion pyramda/iterable/filter.py
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))
5 changes: 4 additions & 1 deletion pyramda/iterable/map.py
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))

0 comments on commit 5bf2008

Please sign in to comment.