Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: andThen for Polynomial? #1337

Open
windymelt opened this issue Jun 9, 2024 · 1 comment
Open

Proposal: andThen for Polynomial? #1337

windymelt opened this issue Jun 9, 2024 · 1 comment

Comments

@windymelt
Copy link

Current Spire has compose for Polynomial[A]:

(f.compose(g).compose(h))(x) // => process h, then g, then f; that's result

But it has no andThen method for Polynomial.

In business context, People prefer more intuitive syntax ---- "Discount, then apply another discount, then add tax".

So implementing andThen alike function is reasonable choice for devs including newcomers.

Please tell me your opinions!

@armanbilge
Copy link
Member

Thanks for the idea! The compose method for Polynomial relates to this mathematical concept.

https://en.wikipedia.org/wiki/Polynomial#Composition

What is the mathematical formulation for andThen?

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

No branches or pull requests

2 participants