Use typesafe equality in an example

This prevents the sort of breakage in
c5980d619dd624288180383125a5dc09ed6b997e (which fixed a (spurious)
warning which should have been an error).
Merge pull request #761 from Blaisorblade/topic/equals

Use typesafe equality in an example