You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Isomorphisms are an interesting example of [morphism](#morphism) because more than single function is necessary for it to be satisfied. Isomorphisms are also [homomorphisms](#homomorphism) since both input and output types share the property of being reversable.
766
782
767
783
### Catamorphism
768
784
769
-
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.
785
+
A function which deconstructs a structure into a single value. `reduceRight` is an example of a catamorphism for array structures.
An `unfold`function. An `unfold` is the opposite of `fold` (`reduce`). It generates a list from a single value.
796
+
A function that builds up a structure by repeatedly applying a function to its argument. `unfold` is an example which generates an array by from a function and a seed value. This is the opposite of a [catamorphism](#catamorphism). You can think of this as a anamorphism builds up a structure and catamorphism breaks it down.
The function which composes a [anamorphism](#anamorphism) followed by a [catamorphism](#catamorphism).
819
+
820
+
```js
821
+
constsumUpToX= (x) =>sum(countDown(x))
822
+
sumUpToX(5) // 15
823
+
```
802
824
803
825
### Paramorphism
804
826
@@ -831,7 +853,7 @@ The third parameter in the reducer (in the above example, `[x, ... xs]`) is kind
831
853
832
854
### Apomorphism
833
855
834
-
it's the opposite of paramorphism, just as anamorphism is the opposite of catamorphism. Whereas with paramorphism, you combine with access to the accumulator and what has been accumulated, apomorphism lets you `unfold` with the potential to return early.
856
+
The opposite of paramorphism, just as anamorphism is the opposite of catamorphism. With paramorphism, you retain access to the accumulator and what has been accumulated, apomorphism lets you `unfold` with the potential to return early.
0 commit comments