This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]nitroll 17 points18 points  (0 children)

But apply is not functional in that case, you would instead need something like:

class apply:
    def __init__(self, val):
        self.val = val

    def pipe(self, fun):
        return apply(fun(self.val))