kachayev / fn.py

Functional programming in Python: implementation of missing features to enjoy FP
Other
3.35k stars 204 forks source link

Implement first_true function #62

Closed gabrielpjordao closed 10 years ago

gabrielpjordao commented 10 years ago

The implementation is an exact copy of 3.4's

An extra commit was added for trimming blank spaces on line endings

kachayev commented 10 years ago

@gabrielpjordao what about docs / tests?

gabrielpjordao commented 10 years ago

@kachayev I just wrote one test. It can be found on https://github.com/gabrielpjordao/fn.py/commit/07b4c8eedba581401550a1b100fbff0f2330e001#diff-f4bc68ff01eef7bed2f3a64cad7d37caR398

I don't like tests like this, testing the function against multiple inputs (I prefer one test with a meaningful name for each case), but I wrote it anyway since it seems that most tests are like this. Do you think I should cover other cases or add more tests?

Regarding the documentation, I really missed it! I'll add first_true to the README.

Let me know if there's anything else left to do :-)

kachayev commented 10 years ago

Ok, waiting for PR update with docs.

kachayev commented 10 years ago

Thanks!