Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ R.add(date(1,2,3), date(1,2,3)) # float('nan)
- [x] 0.3.0 ap
- [ ] aperture
- [x] 0.1.2 append
- [ ] apply
- [x] apply
- [ ] applySpec
- [ ] applyTo
- [ ] ascend
Expand Down
1 change: 1 addition & 0 deletions ramda/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from .any import any
from .ap import ap
from .append import append
from .apply import apply
from .binary import binary
from .chain import chain
from .clone import clone
Expand Down
3 changes: 3 additions & 0 deletions ramda/apply.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .private._curry2 import _curry2

apply = _curry2(lambda fn, args: fn(*args))
16 changes: 16 additions & 0 deletions test/test_apply.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

import unittest

import ramda as R

"""
https://github.com/ramda/ramda/blob/master/test/apply.js
"""


class TestApply(unittest.TestCase):
def test_applies_function_to_argument_list(self):
self.assertEqual(42, R.apply(max, [1, 2, 3, -99, 42, 6, 7]))

if __name__ == '__main__':
unittest.main()