Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Functional > Re: How to avoi...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 5 Topic 2824 of 2841
Post > Topic >>

Re: How to avoid side effects following functional style, when you

by salog <alesmaer@[EMAIL PROTECTED] > Apr 29, 2008 at 01:24 AM

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.




 5 Posts in Topic:
How to avoid side effects following functional style, when you n
salog <alesmaer@[EMAIL  2008-04-28 20:02:07 
Re: How to avoid side effects following functional style, when y
torbenm@[EMAIL PROTECTED]  2008-04-29 09:51:14 
Re: How to avoid side effects following functional style, when y
salog <alesmaer@[EMAIL  2008-04-29 01:24:38 
Re: How to avoid side effects following functional style, when y
torbenm@[EMAIL PROTECTED]  2008-04-29 14:48:54 
Re: How to avoid side effects following functional style, when y
salog <alesmaer@[EMAIL  2008-05-01 23:44:13 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu May 15 22:46:44 CDT 2008.