FizzyElt / functional-programming

帶你探索 functional programming
https://fizzyelt.github.io/functional-programming/
MIT License
25 stars 0 forks source link

Monoid #8

Closed dannypsnl closed 1 year ago

dannypsnl commented 1 year ago

Monoid 是由集合 $S$ 跟下述簽名組成的

$$ \displaylines{ 1 : S \ \otimes : S \times S \to S } $$

並滿足相等規則

  1. $(a \otimes b) \otimes c = a \otimes (b \otimes c)$
  2. $a \otimes 1 = a = 1 \otimes a$

因此 Monoid 恰好是只有一個物件的 locally small category,identity morphism 對應 $1$,而組合兩個 morphism 正好得到另一個 morphism

FizzyElt commented 1 year ago

幫我看一下 PR 是否有誤的地方需要修改 🙏🏼