26

Re: Laziness vs. Calculation when the data is accessible

Hello, Manticore, you wrote: M> Hello, dsorokin, you wrote: D>> the Recursive calculations just  are very convenient for practice. If it is is more specific, it is so-called "the recursive notation do". I use at myself for short determination of ordinary differential equations, for example. M> And it is possible a code sample? I just now deal with a similar problem, it would be interesting to look. It is possible to argue with how much it is practical. For me even very much: model:: Simulation Results model = mdo a <- integ (- ka * a) 100 b <- integ (ka * a - kb * b) 0 c <- integ (kb * b) 0 let ka = 1 kb = 1 return $ results [resultSource "a" "variable A" a, resultSource "b" "variable B" b, resultSource "c" "variable the C" c] Is my Ajvika (English Aivika). At it the fad in strong support it is discrete-sobytijnogo simulations, but there is also a systems dynamics support. In an example the most interesting in how three integrals a, b and c are defined. Type Dynamics Double, but function integ has everyone returns approximation of integral within the limits of calculation Simulation on the set derivative and starting value, to be exact integ:: Dynamics Double-> Dynamics Double-> Simulation (Dynamics Double) Focus that Simulation is MonadFix that is why it is possible to use the recursive notation do. Here in an example it is designated by a keyword "mdo". Yes, for understanding. Dynamics Double is Num: instance Num a => Num (Dynamics a)

27

Re: Laziness vs. Calculation when the data is accessible

Hello, Manticore, you wrote: M> Hello, dsorokin, you wrote: D>> the Recursive calculations just  are very convenient for practice. If it is is more specific, it is so-called "the recursive notation do". I use at myself for short determination of ordinary differential equations, for example. M> And it is possible a code sample? I just now deal with a similar problem, it would be interesting to look. Here, more interesting example. It is cast by an example from the documentation to Vensim: https://github.com/dsorokin/aivika-expe … l/Model.hs