-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
I just want to point this out.
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))
.
Metadata
Metadata
Assignees
Labels
No labels