deriving (was Re: storing to a file)

Andrew J Bromage
Fri, 15 Nov 2002 09:51:21 +1100

G'day all.

On Thu, Nov 14, 2002 at 09:56:24AM -0500, Mark Carroll wrote:

> Actually, "deriving binary" would be a nice
> thing to have in general - even more, a way to add your own "deriving"
> things from within Haskell, although I have no idea how such a thing would
> work.

Actually, there's one situation where it would work easily, and that
is when used with newtype.  Apart from "Show" and "Read", which are
special cases anyway, the "deriving" operation on newtype has a simple
meaning: inherit instances from the type being wrapped.


Andrew Bromage