Send Beginners mailing list submissions to
        beginners@haskell.org

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
        beginners-requ...@haskell.org

You can reach the person managing the list at
        beginners-ow...@haskell.org

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


Today's Topics:

   1. Re:  questions about product types (Brent Yorgey)


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

Message: 1
Date: Sun, 8 Jan 2012 14:43:48 -0500
From: Brent Yorgey <byor...@seas.upenn.edu>
Subject: Re: [Haskell-beginners] questions about product types
To: beginners@haskell.org
Message-ID: <20120108194348.ga12...@seas.upenn.edu>
Content-Type: text/plain; charset=us-ascii

On Fri, Jan 06, 2012 at 09:28:21PM +0000, Tom Doris wrote:
> 
> My questions are:
> 1) I presume this approach has been explored and probably there is a well
> thought through library of helper classes and functions already out there,
> can someone please point me to it?

One package which I think is similar is

  http://hackage.haskell.org/package/has

> 2) I don't know much about Haskell generics, but for product types in which
> all contained values are distinct types, it should be possible to
> automatically derive instances of Extract, since there's never ambiguity as
> to which field you want from a container if you've specified the type of
> value you want, is this possible, and if so does it already exist?

It's easy to extract a field of a certain type using a generic
traversal (of the sort found in packages like uniplate or syb).  To
automatically derive instances of Extract I think you would have to
use Template Haskell.

> 3) In type theory, are product types consisting of distinct member types
> considered special in any way? i.e. does the concept have a name and what
> special properties do they have?

Not that I know of.

-Brent



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

_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners


End of Beginners Digest, Vol 43, Issue 12
*****************************************

Reply via email to