
Categories for Programmers: The Yoneda Lemma - hectorxp
http://bartoszmilewski.com/2015/09/01/the-yoneda-lemma/
======
jonnybgood
This reminded of an OCamlers critique of Haskell [1], which I think raises a
very good point:

 _Yoneda-crazy: I know Haskell, I know some category theory, but I am highly
sceptical that teaching the Yoneda Lemma to C++ programmers is actually useful
in any way. I am the first to applaud the idea of scientific curiosity, of
learning fun stuff of unclear usefulness just for the fun of it, but I think
that a few excellent writers and tinkerers have given the Haskell community as
a whole (and the foreigners that receive some of its TV shows by satellite)
the wrong impression that the theoretical underpinning of typed functional
programming is category theory. I would say that (1) it 's a gross over-
simplification of what the theory of typed functional programming is about,
emphasizing a small part of it that has enabled some people to do very
interesting things and (2) it is highly likely to be absolutely useless to an
overwhelming large majority of the readers of such popularization material.
Category Theory is fashionable these days, and I find the fashion aspect
irritating -- it may be that I'm just bitter? I'm worried that we may have a
backslash at some point when, you know, people realize that unless your
initials are E.K. you are wasting your time thinking about the co-density
transformation. On the other hand, this category circus has been going on for
years, and I believe nobody has been hurt so far, so maybe it's just fine. _

[1]
[https://www.reddit.com/r/ocaml/comments/3ifwe9/what_are_ocam...](https://www.reddit.com/r/ocaml/comments/3ifwe9/what_are_ocamlers_critiques_of_haskell/cugbbbw)

~~~
tel
He was pretty directly referencing Dr. Milewski, I'm sure. He's a relatively
famous C++ guy from my understanding who of late has been doing this whole
category theory for programmers series.

Which is a shame because the whole series is gold.

------
kazinator
Can someone kindly explain this in terms of word-sized chunks of data made of
bits, grinding through a Von Neumann machine, perhaps illustrated using C code
snippets?

~~~
dkarapetyan
Nope, can't be done. You'd basically need to build up an entirely different
language for manipulating symbols to even make any sense of it. That new
language would look very much like ML, Coq, Agda, Haskell, etc.

I think people forget that it's ok to not know any of this stuff. You can
spend an entire lifetime writing nothing but Java and you won't miss out on
anything.

There is no reason to understand this beyond the technical challenge of
understanding it. It will never be useful in any actual day-to-day software
engineering endeavor because whatever you can do with the Yoneda lemma you can
do without it and the Yoneda lemma does not make the solution any better, it
does not make reasoning about large scale dynamic systems any easier, and it
will not make your software less prone to bugs.

~~~
kazinator
> _You 'd basically need to build up an entirely different language for
> manipulating symbols to even make any sense of it._

No problem:

    
    
      struct symbol {
        obj_base_fields; // macro
        obj name_string;
        obj package;
        // ...
      };
    
      struct cons {
        obj_base_fields; // macro
        obj car, cdr;
      };

~~~
tel
Tbh, I find lisp to be a pretty annoying language for talking about this
stuff. It seems to aim just slightly below the right level of abstraction by
talking about symbols where you really want to have abstract binding trees.

I'd like to see a lisp where ABTs were given a more prominent frontline
treatment. That'd complete the "locality" story that often gives people pause
when implementing macros.

------
mordocai
Started reading this, was confused, thought "WTH this is for programmers(not
computer scientists)?". Then realized it is part 14. Oh well, guess I need to
start at part 1...

~~~
andrzejsz
Yes but it is fairly approachable and indeed it was written in progeammers in
mind

~~~
mordocai
Oh yeah, I wasn't meaning to complain really. It just made no sense to me
because I hadn't already read part 1 - 13 I'm sure.

------
asdftemp
a simpler introduction [http://blog.sigfpe.com/2006/11/yoneda-
lemma.html](http://blog.sigfpe.com/2006/11/yoneda-lemma.html)

------
backlava
Programmers, yo don't neda lemma.

------
andrzejsz
Quicker than me congrats :)

