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
The accumulator needs to be more flexible so that it can work correctly with the Range operator and Sum. The problem at the moment is to do with how the accumultaor is initialised. When the range operator is in play, the items in the observable are generated by an in based for loop. This means that we have to use a Num instance of Item[T]. But, that means the accumulator must also initialised with a Num. But doing this breaks the Sum operator which works on native instances of Item and means Item[T].V is in place because the opaque field is un-set (remains as nil; can't be initialised to 0). The client should have more control over the accumulator.
As I write this, it occurs to me that the Range operator could be improved to not just work with Num instances of Item[T]; this should be addressed in another issue (#232), which should be implemented first before this one.
The text was updated successfully, but these errors were encountered:
The accumulator needs to be more flexible so that it can work correctly with the Range operator and Sum. The problem at the moment is to do with how the accumultaor is initialised. When the range operator is in play, the items in the observable are generated by an in based for loop. This means that we have to use a Num instance of Item[T]. But, that means the accumulator must also initialised with a Num. But doing this breaks the Sum operator which works on native instances of Item and means Item[T].V is in place because the opaque field is un-set (remains as nil; can't be initialised to 0). The client should have more control over the accumulator.
As I write this, it occurs to me that the Range operator could be improved to not just work with Num instances of Item[T]; this should be addressed in another issue (#232), which should be implemented first before this one.
The text was updated successfully, but these errors were encountered: