Saizan (IRC) suggested: “what about using phatom types to annotate the encoding and use a typeclass to unify the interfaces?”