Skip to content

Commit

Permalink
oops
Browse files Browse the repository at this point in the history
  • Loading branch information
Technologicat committed Mar 14, 2019
1 parent c2ec623 commit 6eed5b2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions unpythonic/test/test_fold.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ def noneadd(a, b):

# Lazy map, like Python's builtin.
def makeop(f):
@rotate(-1) # --> *elts, acc
@rotate(-1) # --> op(*elts, acc)
def op(acc, *elts):
return f(*elts)
return op
mymap_ = curry(lambda f: curry(scanl, makeop(f), None)) # (None, *map(...))
mymap2 = lambda *iterables: tail(mymap_(*iterables))
mymap_ = curry(lambda f: curry(scanl, makeop(f), None)) # --> (None, *map(...))
mymap2 = lambda *args: tail(mymap_(*args))
assert tuple(curry(mymap2, myadd, (1, 2, 3), (2, 4, 6))) == (3, 6, 9)

reverse_one = curry(foldl, cons, nil)
Expand Down

0 comments on commit 6eed5b2

Please sign in to comment.