4 ms·
These slides do the same misleading thing all the other slides I've looked at do: show examples where there are only an arrow or two between objects. I still do
by losvedir 12y ago
These slides do the same misleading thing all the other slides I've looked at do: show examples where there are only an arrow or two between objects. I still don't really understand category theory, but one breakthrough I had was when I realized that two objects can (and often do) have LOTS (or even infinite) arrow between them.
For example, in a category of "types", each object could be a type (e.g.: int, float, list(int), etc.), and each arrow could be a function between those types.
With that example, just think of all the arrows between, say, string -> int! There's "length()", "md5()", "to_i()", etc. And don't even get me started on the "identity" arrows of string back to itself (upcase, downcase, strip, etc). We're talking gazillions of arrows.
- tfgg 12y agoSo, on slide 33, the "+1" and "bestFriend" arrows are identities of Int and Person? On slide 35 it says that identity is associated with the identity function, but to me that means a function that returns what you give it, rather than "+1", which gives you the next number. So the identity of Person just means any function with the type signature Person->Person?
- orbifold 12y agoNo, the identity id:A->A is characterized by the property that for all arrows f:B->A and g:A->C (P1) id . f = f and (P2) g . id = g, in particular it is unique, since if id':A->A had the same property, then id' = id . id' = id, where the first equality follows by (P1) and the second by (P2').
- tfgg 12y agoOk, I think I got the wrong idea that the identity was any arrow pointing back on to an object. Thanks.
- cheatsheet 12y agoI just sort of abstract over the specifics of the implementation of arrows and assume there is an arrow that denotes the 'kind' of arrow. Does it express a monotonic function (order preserving), does it express a non monotonic function (permutation of elements, ordering of computation of 'typical' threads). It groups functional operations into kinds that you can make assertions about after a selection of the operations have been performed. Haskell does - add :: Integer -> Integer -> Integer so the compiler can check all the branches of code to ensure that statement is invariant.
- jackmaney 12y agoThere's an old mathematical wive's tale about the professor who, on the beginning of the first day of an abstract algebra course, writes the following definition down on the board: Definition: A group is a category with a single object, all of whose morphisms are both epic[1] and monic[2]. In particular, if you drop the epic and monic requirements, a category that has only one object can be viewed as a monoid[3] under morphism composition. [1]: http://en.wikipedia.org/wiki/Epimorphism http://en.wikipedia.org/wiki/Epimorphism [2]: http://en.wikipedia.org/wiki/Monomorphism http://en.wikipedia.org/wiki/Monomorphism [3]: http://en.wikipedia.org/wiki/Monoid http://en.wikipedia.org/wiki/Monoid