3 ms·
I've gotta be honest, I've read about half of this so far and I'm not quite sure what I'm looking at. Every object conforms to an interface, including some err
by nchelluri 10y ago
I've gotta be honest, I've read about half of this so far and I'm not quite sure what I'm looking at.
Every object conforms to an interface, including some error handling functions. The interface is about composition and transformation and iteration/operation (map).
Is this about functional programming? It seems like it must, but I know very little about that and still have no real idea what the benefit of this is or even its purpose.
Edit: So I see that these are algebraic properties that are being defined, to relate it to my limited knowledge I see that Setoid define an equivalence relation interface, equals, which your objects must conform to.
My next question is what is the benefit of programming like this? Maybe I'd have to brush up on my algebra and learn how these relationships/"specifications" are useful.
I am actually kinda curious about this, but it's a little hard to penetrate.
- keithnz 10y agomaybe you might want to start here :- https://drboolean.gitbooks.io/mostly-adequate-guide/content/ https://drboolean.gitbooks.io/mostly-adequate-guide/content/ around ch9 ( https://drboolean.gitbooks.io/mostly-adequate-guide/content/ch9.html https://drboolean.gitbooks.io/mostly-adequate-guide/content/... ) they start mentioning fantasy-land and you should also have a good background in what FL is trying to achieve.
- nchelluri 10y agoLooks interesting, thank you for the link. I've already dived in to the first chapter.
- danidiaz 10y agoI think one benefit is facilitating "getting to grips" with new code, much like design patterns in a way. Of course, this requires familiarity. If someone tells you something is a "monoid", you instantly know that the somethings can be combined in an associative way, and that there is a "neutral" something that can always be constructed without arguments. Another benefit is that these abstractions appear again and again under many contexts. Recognizing them allows you to give them a common interface, instead of flatMap for lists, andThen for promises, and so on.