sonntagsgesicht/curves ? reverse-engineered prompt
Reverse engineered prompt
Build me a small Python library for functional curve algebra, where functions can be treated like algebraic objects and combined naturally with operators like +, , , /, *, and function composition. I want to be able to create an identity curve, constant curves, and a symbolic X object, then build expressions like 2 * X ** 2 + 3 * X + 1 and evaluate them at a number.
It should also support composing curves by calling one curve with another curve, and with the @ operator too, so both ways behave the same. Please make it feel clean and Pythonic, with readable string representations for expressions, and include a few examples or tests showing that identity, constants, polynomial building, evaluation, and composition all work as expected.
If anything is unclear, look up current docs online if you need to, but keep the implementation lightweight and focused on the curve algebra behavior.
Are you gonna build this?
make sure you review the code using coderabbit