Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Tweaked README

  • Loading branch information...
commit e5572824f00261aaa699d381a78d7a3042785cae 1 parent 41eba18
@sdiehl authored
Showing with 18 additions and 8 deletions.
  1. +18 −8 README.md
View
26 README.md
@@ -3,27 +3,37 @@ opcurry
Curried versions of Python operator module.
+Note: This is currying, not partial function application. Which is not
+the same as ``functools.partial`` from the standard library.
+
+Install
+-------
+
+```bash
+$ python setup.py install
+```
+
Usage
-----
```python
->>> import opcurry
+>>> from opcurry import mul, add, xor, and_, neg
->>> f = opcurry.add(1)
->>> f(2) == 3
->>> f(3) == 4
+>>> f = add(1)
+>>> f(2)
+3
+>>> f(3)
+4
->>> opcurry.neg(1)
+>>> neg(1)
-1
->>> h = opcurry.and_(True)
+>>> h = and_(True)
>>> h(True)
True
>>> h(False)
False
->>> from opcurry import mul, add, xor
-
>>> map(add(1), [2,3,4])
[3, 4, 5]
Please sign in to comment.
Something went wrong with that request. Please try again.