Re: RfD: more powerful "any" types - Mailing list pgsql-hackers

From Sam Mason
Subject Re: RfD: more powerful "any" types
Date
Msg-id 20090909205139.GM5407@samason.me.uk
Whole thread Raw
In response to Re: RfD: more powerful "any" types  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Wed, Sep 09, 2009 at 03:23:52PM -0400, Tom Lane wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
> > What we need is a system where base types are represented
> > by an OID, but derived types (list and functional types) are built up
> > using type constructors that take other types as arguments.
> 
> This is SQL, not Haskell.  What you suggest seems about two orders of
> magnitude more complex than real-world applications could justify.

Parametric polymorphism seems to have made it well into the mainstream
now, Java, C# and many other "mainstream" languages have got it, it's
not just ML and Haskell any more.  Excuses of it being of esoteric
academic interest alone seem a little misplaced.

It would also tidy up a lot of the features that already exist in PG.
Arrays in PG already effectively have a type parameter, why not extend
this to normal user's code?  Even staying within the types in PG,
I've wanted to use the geometric functions parametrized over integer
and numeric types before, fixing them to double precision types seems
unfortunate.

--  Sam  http://samason.me.uk/


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Ragged CSV import
Next
From: Hannu Krosing
Date:
Subject: Re: Ragged CSV import