evilsoft / crocks

A collection of well known Algebraic Data Types for your utter enjoyment.
https://crocks.dev
ISC License
1.59k stars 102 forks source link

Adding in support for Auto and manually curried functions unary/binary/nary #421

Closed dalefrancis88 closed 5 years ago

dalefrancis88 commented 5 years ago

This is work to better add support for all function types.

This will address this issue, https://github.com/evilsoft/crocks/issues/360

This will sequentially apply the arguments and then recursively apply undefined until a non-function value is returned.

@evilsoft this is the work i promised a while back, i think it's the nicest i can make it for what its doing. What i'd like to know is could i make use of Function.bind or fn.apply here to clean it up more? googleing did not shed much light on the difference Also i can't get the test to pass but i think it may be more around how the test is written, thoughts?

dalefrancis88 commented 5 years ago

@evilsoft check this out if you like but I realised as I was falling asleep that I broke this for variadic functions. Will fix it

dalefrancis88 commented 5 years ago

kk @evilsoft this one was painful, i understand your original hesitation now, this is committed to start discussion, going to let my mind think through ways to improve but would love some 👀

dalefrancis88 commented 5 years ago

Looks like they'res some issues with liftN i'm going to have to address

dalefrancis88 commented 5 years ago

We're going to approach this a different way