Why define a single natural transformation of a monad - is this not implied by the definition of a monad, which is an endonuktor?

  • A monad is defined as an endofunctor on category C. Let's say C is of type int and bool and other constructed types as objects. Now think of the list monad defined above this category.

Thus, the definition list itself is an endofunctor, it displays (can this be interpreted as a function?) The int type in List [int] and bool to List [bool] of and maps (function again?) A morphism int → bool to List [ int] → List [bool]

So far, that makes sense. But what throws me into deep confusion is the additional definitions of the natural transformations that should accompany it: a. A unit ... that converts int to List [int] (doesn't that mean the definition of a List functor? This is one of the main confusions I have

b. List functionality should always be understood as a mapping from int to List [int] not from int to List [bool]?

with. Is the unitary natural conversion of int to List [int] different from map from int to List [int], the implied definition of List as a functor? I think this is just a repeat of my previous question.

+3
source share
2 answers

Identity C List; , a: F = > G F, G: X → Y

  • x: X , a_x: Fx → Gx
  • , F G

, , "" F G. List, Unit X Unit_X: X → List [X], List [X] .

, b. c. . int to List [int], ; , , f: X → Y, map List (f): List [X] → List [Y]; , Unit, - X X, .

, ; List [], , Scala/Java, , Scala : http://www.weiglewilczek.com/blog/?p=2760

+2

, , F Cat A Cat B :

:

  • F A F (A) --- List()? ?
  • F F (f): F (A) → F (B)

, . № 1 (F- A F (A)), A F (A). , , A F (A)?

, , ( ). , A F (A) , .

0

All Articles