You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What do you think about adding some more fundamental operators to this library @talex5 ?
In writing some documentation on using this library outside of ocurrent I ended up defining the following functions.
Then you can write code like this in a more natural style.
letrec mergear~f=ifArray.length ar <=1then ar.(0)
elselet len =Array.length ar inlet len' = len /2+ (len mod2) inlet ar' =Array.init len' (funi ->
if i *2+1>= len then ar.(i*2)
elseCurrent_incr.map2 f ar.(i*2) ar.(i*2+1))
in
merge ar' ~fletaveragear=let sum = merge ar ~f:(+.) inCurrent_incr.map (funs -> s /.float (Array.length ar)) sum
letaverage_of_prefixarlength=Current_incr.bind (funlength ->
average (Array.init length (funi -> ar.(i)))) length
The text was updated successfully, but these errors were encountered:
What do you think about adding some more fundamental operators to this library @talex5 ?
In writing some documentation on using this library outside of
ocurrent
I ended up defining the following functions.Then you can write code like this in a more natural style.
The text was updated successfully, but these errors were encountered: