Open chamini2 opened 8 years ago
Yeah. It's too bad you have to keep defining your own equality function for everything in JS. Especially since it's generally considered a bad practice to modify native prototypes.
I think that the examples are written in JS to make it easier to understand, but they're not the best practices nor intended to be. They're just to clarify any doubt left in the description of the functional programming term.
I think the code we display should be moderately practical. It can be incomplete or have uncovered cases. But people should be able to copy it
On Wed, Jul 27, 2016, 5:23 AM Matteo Ferrando notifications@github.com wrote:
I think that the examples are written in JS to make it easier to understand, but they're not the best practices nor intended to be. They're just to clarify any doubt left in the description of the functional programming term.
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/hemanth/functional-programming-jargon/issues/82#issuecomment-235569110, or mute the thread https://github.com/notifications/unsubscribe-auth/AAB-4A0qmzthe_XzQ4fmk8AH4HgyB7i8ks5qZ029gaJpZM4JVQoz .
Well, this is code that can be copied.
The example of setoid uses equality between the elements of the array but it assumes there's an equality operator (
==
) between the elements of the setoid.I would do the following: