Hello everybody,

I have a little question I wanted to run by the folks here. I've run into it several times over the past few years and would love to lock down a good answer.

What's the best way to "fingerprint" a Haskell object into, say, ByteString, so that this fingerprint can be used as the "lookup key" in a database (for example) and be trusted that it will remain constant over time even as the underlying libraries evolve?

Here's a simple example:

Here are some ideas (and related concepts) I've considered and used over the years:
What would be your preferred solution?

Thank you,
Oz