On Wed, Sep 9, 2009 at 3:23 PM, Tom Lane<tgl@sss.pgh.pa.us> 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.
>
> (so where is pl/haskell, anyway?)
There are languages much less obscure than Haskell that support
passing functions as arguments to other functions, such as C. While
C doesn't support user-defined type constructors, it does support one
built-in type constructor - you can declare a function argument as
taking arbitrary argument types and returning an arbitrary type. C++
supports user-defined type constructors via the template mechanism.
The scripting languages generally do not guarantee type-safety for
functions passed as arguments, but they do let you pass them.
However, I can't really imagine how we could get away with such a
system in SQL, due to security concerns.
...Robert