[Haskell-beginners] Orphan instances

Emmanuel Surleau emmanuel.surleau at gmail.com
Thu Nov 22 22:55:59 CET 2012


Hi there,

I have a design issue, which is causing me to generate orphan instances. I'm
writing a small program which persists data to a database. In order to be able
to switch between different backends, I have a Store typeclass in one module,
which is exposed to the frontend, and which has instances in each backend
module. But obviously, the backend instances are therefore orphan. Is there a
better solution which would let me keep the concrete implementation separate
from the interface?

Thanks,

Emm



More information about the Beginners mailing list