This is a playground of code behing a blog post on initial and final encodings using Backpack.
You probably want to look here for the post itself.
You need GHC 8.2 and Cabal 2.0 or greater to play around with it, and then
cabal new-build all
should get things building for you.