feat!: change 'event lists/seq to consistently use arrays #411
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes the standard signatures to remove variation that was not earning its keep:
fold
signature from'state -> 'event seq -> 'state
to'state -> 'event[] -> 'state
let fold = Array.fold evolve
never needs type annotationsArray.last
)[|
comprehensions vsseq {
tends to produce less noiseDecider
'sinterpret
anddecide
function signatures to use[]
instead oflist
Sync
is required, so any perf or allocations argument is not relevantyield
in F# 6 is simply a better more general patternDeciderCore
'sinterpret
anddecide
function signatures to use[]
instead ofseq
IEnumerable
viayield break
...Decider
impl can more directly use the Array impls, which makes the whole thing more legibleThis leaves the key differences between the
Decider
andDeciderCore
interfaces clearer:Func
vsFSharpFunc
(mapped internally to Func)CancellationToken
s everywhere vs everything just workingstruct
ValueTuples
vsSystem.Tuple
(open to nudging on this)ValueTuple.Create
is not the point,async
is already way more allocation heavy anywayasync
andtask
atm involves introducingstruct
noise in codeThe base of this work is identical to #409; Props to @nordfjord for thinking it could be done, nudging me for ages, and then proving it!