On Wed, May 11, 2011 at 11:43 AM, Joseph Adams <joeyadams3.14...@gmail.com> wrote: > On Tue, May 10, 2011 at 5:19 PM, Darren Duncan <dar...@darrenduncan.net> > wrote: >> Examples of open union types could be number, which all the numeric types >> compose, and so you can know say that you can use the generic numeric >> operators on values you have simply if their types compose the number union >> type, and it still works if more numeric types appear later. Likewise, the >> string open union could include both text and blob, as both support >> catenation and substring matches or extraction, for example. >> >> This would aid to operator overloading in a generic way, letting you use the >> same syntax for different types, but allowing types to mix is optional; eg, >> you could support "add(int,int)" and "add(real,real)" without supporting >> "add(int,real)" etc but the syntax "add(x,y)" is shared, and you do this >> while still having a strong type system; allowing the mixing is optional >> case-by-case. > > Coming from a Haskell perspective, this is a great idea, but I don't > think the "union" feature should be used to implement it.
I'm unclear what the point of such a feature would be. A union of all the common numeric types is not much different from the existing type "numeric". -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers