Send Beginners mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1.  Orphan instances (Emmanuel Surleau)
   2. Re:  Orphan instances (Brent Yorgey)


----------------------------------------------------------------------

Message: 1
Date: Thu, 22 Nov 2012 22:55:59 +0100
From: Emmanuel Surleau <[email protected]>
Subject: [Haskell-beginners] Orphan instances
To: Haskell Beginners <[email protected]>
Message-ID: <20121122215559.GA23458@mercurialalchemist>
Content-Type: text/plain; charset=us-ascii

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



------------------------------

Message: 2
Date: Thu, 22 Nov 2012 21:39:35 -0500
From: Brent Yorgey <[email protected]>
Subject: Re: [Haskell-beginners] Orphan instances
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii

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



------------------------------

_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners


End of Beginners Digest, Vol 53, Issue 28
*****************************************

Reply via email to