Skip to content

Commit 1d15590

Browse files
committed
add Homomorphism
1 parent 72fe695 commit 1d15590

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

readme.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ __Table of Contents__
5151
* [Morphism](#morphism)
5252
* [Endomorphism](#endomorphism)
5353
* [Isomorphism](#isomorphism)
54+
* [Homomorphism](#homomorphism)
5455
* [Catamorphism](#catamorphism)
5556
* [Anamorphism](#anamorphism)
5657
* [Hylomorphism](#hylomorphism)
@@ -696,6 +697,16 @@ coordsToPair(pairToCoords([1, 2])) // [1, 2]
696697
pairToCoords(coordsToPair({x: 1, y: 2})) // {x: 1, y: 2}
697698
```
698699

700+
### Homomorphism
701+
702+
A homomorphism is just a structure preserving map. In fact, a functor is just a homomorphism between categories as it preserves the original category's structure under the mapping.
703+
704+
```js
705+
A.of(f).ap(A.of(x)) == A.of(f(x))
706+
707+
Either.of(_.toUpper).ap(Either.of("oreos")) == Either.of(_.toUpper("oreos"))
708+
```
709+
699710
### Catamorphism
700711

701712
A `reduceRight` function that applies a function against an accumulator and each value of the array (from right-to-left) to reduce it to a single value.

0 commit comments

Comments
 (0)