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
init=OnInit(f) is another one of these things like Union{T,Nothing} I'm always complaining about, which I might be calling "unbalanced unions". This instance is much milder than most because it's in the argument rather than the return and OnInit is pretty much only for this purpose.
reduce(op, xs; init=OnInit(f)) doesn't pass an OnInit value to op. Instead it special-cases init values of that type and calls the function inside it. It'll probably be fine, but this isn't really correct. More properly it should be reduce(op, xs; oninit=f) or rejigger the whole init API to require a wrapper reduce(op, xs, Init(0)) | reduce(op, xs, OnInit(f)).
The text was updated successfully, but these errors were encountered:
I just want to point this out.
init=OnInit(f)
is another one of these things likeUnion{T,Nothing}
I'm always complaining about, which I might be calling "unbalanced unions". This instance is much milder than most because it's in the argument rather than the return andOnInit
is pretty much only for this purpose.reduce(op, xs; init=OnInit(f))
doesn't pass anOnInit
value toop
. Instead it special-casesinit
values of that type and calls the function inside it. It'll probably be fine, but this isn't really correct. More properly it should bereduce(op, xs; oninit=f)
or rejigger the wholeinit
API to require a wrapperreduce(op, xs, Init(0)) | reduce(op, xs, OnInit(f))
.The text was updated successfully, but these errors were encountered: