TITLE: Basic Example of Yoneda Lemma?
QUESTION [14 upvotes]: I have been digging the whole internet and books on category theory trying to understand the Yoneda Lemma. I have read the Tom Leinster's "Yoneda Lemma: Whas is it all about?", and watched the talk of Steve Awdoey on that subject as well. Both of them did help me a lot, and I'm starting to understand the matter. 
However, most of the examples I could find always relate to things on mathematics that I haven't had any touch with (such as Rings, Groups, Topos, ...). I'm a Computer Science Student, and I know the very basics of Category Theory (Sets, Posets, Sets and Partial Functions, Graphs, all seen as a category).
Is there any example you can give me (or know of) that uses the Yoneda Lemma and basic knowledges of category theory? I'm interested on an example of the application of the Lemma or the Embedding to solve or prove something.

REPLY [4 votes]: Programming with continuations
You may have seen the continuation-passing style of programming. Starting with a subroutine like this:
function f (x, y, z) {
  return [result]
}

...you alter it so that instead of returning its result directly, the subroutine returns another subroutine that allows you to process that result before returning it:
function f (x, y, z) {
  return function(CONTINUE_FN) { 
         return CONTINUE_FN([result])
  }
}

That is, instead of returning result directly, it returns another subroutine; you pass a function $g$ to that subroutine and it returns $g(result)$.  For example, if you pass the identity function g(x){return x}, it'll just return the result directly.
This paradigm is useful for when you want to decide how to further process/handle return values at a later, asynchronous time. It is useful for event handling, exception handling, and co-routines, for example.

The Yoneda lemma proves that the direct style of programming and the continuation-passing style of programming are equivalent (naturally isomorphic). 
Indeed, consider the datatypes returned by the direct and continuation-passing  variants. Say the direct subroutine returns objects of type $\mathsf A$.  The continuation subroutine instead returns a function. That function takes in a continuation $\mathsf A \rightarrow \mathsf R$, where $\mathsf R$ can be any data type, and returns a result of type $\mathsf R$.
The fact that these return structures are equivalent is an isomorphism: 
$$\mathsf A \cong (\mathsf A \Rightarrow \mathsf R) \Rightarrow \mathsf R$$
This equivalence, as can be made precise, is an application of the Yoneda Lemma in the case where the functor is just the identity functor:
$$\mathrm{Nat}( \hom(\mathsf{A}, -), \mathrm{id}) \cong \mathrm{id}(\mathsf A)$$