Re: How to avoid side effects following functional style, when you need to write adn read data to/from database.



On 29 апр, 18:51, torb...@xxxxxxxxxxxxx (Torben Ægidius Mogensen)
wrote:
salog <alesm...@xxxxxxxxxx> 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.



.



Relevant Pages

  • Re: How to avoid side effects following functional style, when you need to write adn read data to/f
    ... reading data is alike set and get external variables, ... every side-effect function should have a fake argument - a functions, ... For example, function a0writes to a database, function b0reads ... For example, to interact with a file, you need ...
    (comp.lang.functional)
  • Re: Wanna try SolidDB for IDS?
    ... You need to understand risk and how to assess the risk and the ... I have a production database sitting on a single SATA drive. ... there is going to be data loss. ... mitigate this risk such that you can live with an in memory database. ...
    (comp.databases.informix)
  • Re: Wanna try SolidDB for IDS?
    ... You need to understand risk and how to assess the risk and the ... I have a production database sitting on a single SATA drive. ... there is going to be data loss. ... mitigate this risk such that you can live with an in memory database. ...
    (comp.databases.informix)
  • Re: Wanna try SolidDB for IDS?
    ... there is going to be data loss. ... loss than a traditional relational database. ... database keeps all the data in memory or only some of the ... then they are all exactly equal in their risk of data ...
    (comp.databases.informix)
  • Re: ID cards will be compulsory; business will have access to information
    ... >> database would deduce from the data. ... >> The information at risk is the thirteen biometrics, ... People who've been trusted to keep the information secure ...
    (uk.politics.misc)