Skip to main content
4 events
when toggle format what by license comment
Dec 16, 2019 at 18:56 comment added Bartosz Milewski List of int is just like string. In fact, in Haskell, String is defined as a list of Char. List of a, where a is not specified, is an (endo-) functor because it maps all objects (types) a to objects (types). It maps int to list of int, char to list of char, and so on. It's like f(x) with x being arbitrary vs. f(42).
Dec 16, 2019 at 15:56 vote accept Crell
Dec 15, 2019 at 17:17 comment added Crell Thanks! So if I follow correctly, it's valid to use either of the first two perspectives depending on what it is you want to describe? So an string->int function is a morphism and a string->string function an endomorphism, but they're not useful to think of as a functor even though you could. But "int with null" or "list of int" are valid alternate categories, which you can convert to with a functor. Following? (Context: I'm reading your book and trying to translate the concepts for PHP devs. Because I'm that kind of crazy.)
Dec 15, 2019 at 5:16 history answered Bartosz Milewski CC BY-SA 4.0