
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

On Thu, Nov 22, 2012 at 10:55:59PM +0100, Emmanuel Surleau wrote:
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.
This is not obvious to me. What types are you making an instance of Store, and why must they be defined elsewhere? Also, orphan instances internal to your own library are Not A Big Deal. -Brent
participants (2)
-
Brent Yorgey
-
Emmanuel Surleau