Re: leakproof - Mailing list pgsql-hackers

From Tom Lane
Subject Re: leakproof
Date
Msg-id 17828.1329708284@sss.pgh.pa.us
Whole thread Raw
In response to Re: leakproof  (Don Baccus <dhogaza@pacifier.com>)
Responses Re: leakproof  (Don Baccus <dhogaza@pacifier.com>)
Re: leakproof  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Don Baccus <dhogaza@pacifier.com> writes:
> On Feb 19, 2012, at 5:42 PM, Tom Lane wrote:
>> Hmm, "pure" doesn't sound bad to me.  Nice and short.

> Technically, "pure" is stronger than "has no side effects":
> http://en.wikipedia.org/wiki/Pure_function
> Result can't depend on state (for instance, database contents), either.  This is the typical definition used in
functionalprogramming.
 

Well, that condition is subsumed in our idea of an immutable function.
It's not clear to me whether pure/leakproof functions are meant to be a
strict subset of immutable functions, but if they are then they meet
this stricter definition.  On the other hand, if pure/leakproof functions
don't have to be immutable but only stable, then the stricter definition
corresponds to "pure immutable".  That still doesn't sound too bad, as
long as we define our terms clearly in the docs.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: leakproof
Next
From: Greg Stark
Date:
Subject: Re: Future of our regular expression code