Skip to content

Add composition as an operator via a new composable class - #531

Closed
ruancomelli wants to merge 5 commits into
pytoolz:masterfrom
ruancomelli:master
Closed

ruancomelli wants to merge 5 commits into
pytoolz:masterfrom
ruancomelli:master

Conversation

@ruancomelli

Copy link
Copy Markdown

Overview

Add a new composable class for functions that can be composed via the pipe operator. This idea originated from and was discussed in #523.

In this implementation, I decided not to include any type-annotations. This is because most of (all?) the project lacks type-annotations. Adding such annotations is probably a PR of its own.

Future work

  1. Make other tools classes inherit from composable as well, like curry, juxt, and excepts, as suggested in Idea: compose as an operator #523 (comment).
  2. We can probably make something very similar for the pipe function by creating a pipeable class.

@ruancomelli
ruancomelli marked this pull request as draft July 4, 2022 11:04
@ruancomelli

Copy link
Copy Markdown
Author

Converted to draft because of #523 (comment).
We should first settle on the exact desired behavior before having this PR merged.

@GiorgioPicci GiorgioPicci left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvement, thats will help a lot. Thanks for contribute !!

@ruancomelli

Copy link
Copy Markdown
Author

I'll close this PR for now since it is unclear how to proceed (see discussion at #523). If it becomes relevant again, we can either open a new PR or reopen it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants