Skip to content
This repository was archived by the owner on May 29, 2023. It is now read-only.

Curry all combinators #4

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Curry all combinators #4

wants to merge 11 commits into from

Conversation

shadowhand
Copy link
Contributor

@shadowhand shadowhand commented May 31, 2017

This builds off of #3 and makes all combinators curried by default.

See 7608e66 for changes.

@shadowhand shadowhand changed the title Add curried constructors Curry all combinators Jun 1, 2017
@shadowhand
Copy link
Contributor Author

@i-am-tom this is the "ultimate" realization of combinators, making every function curried by default, with the option to use literal combinators when necessary. Eager to hear your opinion about this approach, see 7608e66.

shadowhand added 11 commits June 1, 2017 09:13
Having an immutable `Curry` class allows creating a curry from any
callable. Having this as a base class will allow additional
functionality such as `Partial` to be added with minimal effort.
Having all combinators curried by default provides much greater
flexibility for point-free programming.
@i-am-tom
Copy link

i-am-tom commented Jun 2, 2017

Wow! This looks really great! As an update, my broadband has gone on holiday, estimated to be fixed within the next 12 hours, sigh... Once it's back up, I'll have a proper look at this. Regardless, really great work!

This was referenced Jun 3, 2017
},
"files": [
"src/functions.php",
"src/curried.php"

Choose a reason for hiding this comment

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

Should both be exposed? The "uncurried" ones aren't all totally uncurried (thinking of compose, in particular), so it might be more helpful to hide the "original" functions and move them out of sight and mind.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They have to be imported somehow, or PHP won't find them. However, both are contained in namespaces so they won't pollute the global namespace.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants