On 29 =AC=D1=AC=E1=AC=E2, 18:51, torb...@[EMAIL PROTECTED]
(Torben =A8=A1gidius
=
Mogensen)
wrote:
> salog <alesm...@[EMAIL PROTECTED]
> writes:
> > One of the functional programming feature is absence of variables
> > assignments, than allows to avoid side effects. But writing and
> > reading data is alike set and get external variables, so we again come
> > to a risk get side effects working with databases.
> > Are there any ideas how to walk around this risk, excluding 'human
> > element' from the process.
>
> Several answers to this have been used: ...
How would you comment a such way (take into account that I have not
read about Monads yet):
every side-effect function should have a fake argument - a functions,
that destined to indicate what another side-effect function this
function depend on.
?
For example, function a0() writes to a database, function b0() reads
from the database.
But, the idea is that a0() has to read data that b0() has written
earler.
Accordingly, we khow that a0() and b0() are side-effect functions. So,
we can arrange a functional compiler in a such way, that a0() and b0()
can't be declare as is. Our compliler should demand that each of these
function should have one (or more) additional argument-function, just
to indicate mental dependence one function from another one.


|