hemanth / functional-programming-jargon

Jargon from the functional programming world in simple terms!
http://git.io/fp-jargons
MIT License
18.6k stars 1.02k forks source link

Monoid is a bad example when explaining a category #137

Closed dmitriz closed 7 years ago

dmitriz commented 7 years ago

Monoid is given as example of Category?

https://github.com/hemanth/functional-programming-jargon#categories

Monoid comes with binary operation, whereas functions (morphisms) in a Catgory are unary, not binary. So it is very confusing to use Monoid as explanation.

A Category is really a collection of objects (types) and functions (aka morphisms) between types, sending values to values. Further, functions a->b and b->c can be composed, the composition is associative, and there is identity function a->a for each object a.

jethrolarson commented 7 years ago

Yeah, current definition is very wrong. If you can come up with a explain-like-I'm-five definition I'd welcome it.

On Mon, Jan 23, 2017 at 12:58 PM Dmitri Zaitsev notifications@github.com wrote:

Monoid is given as example of Category?

https://github.com/hemanth/functional-programming-jargon#categories

Monoid comes with binary operation, whereas functions (morphisms) in a Catgory are unary, not binary. So it is very confusing to use Monoid as explanation.

A Category is really a collection of objects (types) and functions (aka morphisms) between types, sending values to values. Further, functions a->b and b->c can be composed, the composition is associative, and there is identity function a->a for each object a.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/hemanth/functional-programming-jargon/issues/137, or mute the thread https://github.com/notifications/unsubscribe-auth/AAB-4JQPHhyIX4vsZIERn5w-8pEIlseEks5rVRRYgaJpZM4LriTU .