@@ -11,9 +11,9 @@ type ScalarAttributeComparison =
1111
1212[<Struct; IsByRefLike; RequireQualifiedAccess; NoComparison; NoEquality>]
1313type EnumerationMode < 'a > =
14- | AllAddedOrRemoved of prevAdd : 'a [] * bool // the first element is either prev or next depending on the bool, but using prev as the label allows the compiler to reuse struct fields between cases
14+ | AllAddedOrRemoved of prev : 'a [] * bool // the first element is either prev or next depending on the bool, but using prev as the label allows the compiler to reuse struct fields between cases
1515 | Empty
16- | ActualDiff of prevDiff : 'a [] * next : 'a []
16+ | ActualDiff of prev : 'a [] * next : 'a []
1717
1818module EnumerationMode =
1919 let fromOptions prev next =
@@ -75,31 +75,31 @@ module private SkipRepeatingScalars =
7575
7676[<Struct; IsByRefLike; RequireQualifiedAccess>]
7777type ScalarChange =
78- | Added of added : ScalarAttribute
79- | Removed of removed : ScalarAttribute
80- | Updated of old : ScalarAttribute * updated : ScalarAttribute
78+ | Added of attr : ScalarAttribute
79+ | Removed of attr : ScalarAttribute
80+ | Updated of attr : ScalarAttribute * updated : ScalarAttribute // old * updated
8181
8282and [<Struct; RequireQualifiedAccess>] WidgetChange =
83- | Added of added : WidgetAttribute
84- | Removed of removed : WidgetAttribute
85- | Updated of updated : struct ( WidgetAttribute * WidgetDiff )
86- | ReplacedBy of replacedBy : WidgetAttribute
83+ | Added of widget : WidgetAttribute
84+ | Removed of widget : WidgetAttribute
85+ | Updated of widget : WidgetAttribute * diff : WidgetDiff // updated * diff
86+ | ReplacedBy of widget : WidgetAttribute
8787
8888and [<Struct; RequireQualifiedAccess>] WidgetCollectionChange =
89- | Added of added : WidgetCollectionAttribute
90- | Removed of removed : WidgetCollectionAttribute
91- | Updated of updated : struct ( WidgetCollectionAttribute * WidgetCollectionAttribute * WidgetCollectionItemChanges )
89+ | Added of attr : WidgetCollectionAttribute
90+ | Removed of attr : WidgetCollectionAttribute
91+ | Updated of attr : WidgetCollectionAttribute * updated : WidgetCollectionAttribute * diff : WidgetCollectionItemChanges // old * updated * diff
9292
9393and [<Struct; IsByRefLike; RequireQualifiedAccess>] WidgetCollectionItemChange =
94- | Insert of widgetInserted : struct ( int * Widget )
95- | Replace of widgetReplaced : struct ( int * Widget * Widget )
96- | Update of widgetUpdated : struct ( int * WidgetDiff )
97- | Remove of removed : struct ( int * Widget )
94+ | Insert of index : int * widget : Widget
95+ | Replace of index : int * widget : Widget * replacedBy : Widget // index * old * replacedBy
96+ | Update of index : int * diff : WidgetDiff
97+ | Remove of index : int * widget : Widget
9898
9999and [<Struct; IsByRefLike; RequireQualifiedAccess>] EnvironmentChange =
100- | Added of added : EnvironmentAttribute
101- | Removed of removed : EnvironmentAttribute
102- | Updated of old : EnvironmentAttribute * updated : EnvironmentAttribute
100+ | Added of attr : EnvironmentAttribute
101+ | Removed of attr : EnvironmentAttribute
102+ | Updated of attr : EnvironmentAttribute * updated : EnvironmentAttribute // old * updated
103103
104104and [<Struct; NoComparison; NoEquality>] WidgetDiff =
105105 { ScalarChanges: ScalarChanges
@@ -112,7 +112,7 @@ and [<Struct; NoComparison; NoEquality>] WidgetDiff =
112112 prevOpt : Widget voption ,
113113 next : Widget ,
114114 canReuseView : Widget -> Widget -> bool ,
115- compareScalars : struct ( ScalarAttributeKey * obj * obj ) -> ScalarAttributeComparison
115+ compareScalars : ScalarAttributeKey -> obj -> obj -> ScalarAttributeComparison
116116 ) : WidgetDiff =
117117
118118 let prevScalarAttributes =
@@ -141,7 +141,7 @@ and [<Struct; NoComparison; NoEquality>] WidgetDiff =
141141 EnvironmentChanges = EnvironmentChanges( prevEnvironmentAttributes, next.EnvironmentAttributes) }
142142
143143and [<Struct; NoComparison; NoEquality>] ScalarChanges
144- ( prev : ScalarAttribute [], next : ScalarAttribute [], compareScalars : struct ( ScalarAttributeKey * obj * obj ) -> ScalarAttributeComparison ) =
144+ ( prev : ScalarAttribute [], next : ScalarAttribute [], compareScalars : ScalarAttributeKey -> obj -> obj -> ScalarAttributeComparison ) =
145145 member _.GetEnumerator () =
146146 ScalarChangesEnumerator( EnumerationMode.fromOptions prev next, compareScalars)
147147
@@ -150,7 +150,7 @@ and [<Struct; NoComparison; NoEquality>] WidgetChanges
150150 prev : WidgetAttribute [],
151151 next : WidgetAttribute [],
152152 canReuseView : Widget -> Widget -> bool ,
153- compareScalars : struct ( ScalarAttributeKey * obj * obj ) -> ScalarAttributeComparison
153+ compareScalars : ScalarAttributeKey -> obj -> obj -> ScalarAttributeComparison
154154 ) =
155155 member _.GetEnumerator () =
156156 WidgetChangesEnumerator( EnumerationMode.fromOptions prev next, canReuseView, compareScalars)
@@ -160,7 +160,7 @@ and [<Struct; NoComparison; NoEquality>] WidgetCollectionChanges
160160 prev : WidgetCollectionAttribute [],
161161 next : WidgetCollectionAttribute [],
162162 canReuseView : Widget -> Widget -> bool ,
163- compareScalars : struct ( ScalarAttributeKey * obj * obj ) -> ScalarAttributeComparison
163+ compareScalars : ScalarAttributeKey -> obj -> obj -> ScalarAttributeComparison
164164 ) =
165165 member _.GetEnumerator () =
166166 WidgetCollectionChangesEnumerator( EnumerationMode.fromOptions prev next, canReuseView, compareScalars)
@@ -171,7 +171,7 @@ and [<Struct; NoComparison; NoEquality>] WidgetCollectionItemChanges
171171 prev : ArraySlice < Widget >,
172172 next : ArraySlice < Widget >,
173173 canReuseView : Widget -> Widget -> bool ,
174- compareScalars : struct ( ScalarAttributeKey * obj * obj ) -> ScalarAttributeComparison
174+ compareScalars : ScalarAttributeKey -> obj -> obj -> ScalarAttributeComparison
175175 ) =
176176 member _.GetEnumerator () =
177177 WidgetCollectionItemChangesEnumerator( ArraySlice.toSpan prev, ArraySlice.toSpan next, canReuseView, compareScalars)
@@ -182,7 +182,7 @@ and [<Struct; NoComparison; NoEquality>] EnvironmentChanges(prev: EnvironmentAtt
182182
183183// enumerators
184184and [<Struct; IsByRefLike>] ScalarChangesEnumerator
185- ( mode : EnumerationMode < ScalarAttribute >, compareScalars : struct ( ScalarAttributeKey * obj * obj ) -> ScalarAttributeComparison ) =
185+ ( mode : EnumerationMode < ScalarAttribute >, compareScalars : ScalarAttributeKey -> obj -> obj -> ScalarAttributeComparison ) =
186186
187187 [<DefaultValue( false ) >]
188188 val mutable private current : ScalarChange
@@ -270,7 +270,7 @@ and [<Struct; IsByRefLike>] ScalarChangesEnumerator
270270 res <- ValueSome true
271271
272272 | ScalarAttributeKey.Kind.Boxed ->
273- match compareScalars struct ( prevKey, prevAttr.Value, nextAttr.Value) with
273+ match compareScalars prevKey prevAttr.Value nextAttr.Value with
274274 // Previous and next values are identical, we don't need to do anything
275275 | ScalarAttributeComparison.Identical -> ()
276276
@@ -297,7 +297,7 @@ and [<Struct; IsByRefLike>] WidgetChangesEnumerator
297297 (
298298 mode : EnumerationMode < WidgetAttribute >,
299299 canReuseView : Widget -> Widget -> bool ,
300- compareScalars : struct ( ScalarAttributeKey * obj * obj ) -> ScalarAttributeComparison
300+ compareScalars : ScalarAttributeKey -> obj -> obj -> ScalarAttributeComparison
301301 ) =
302302
303303 [<DefaultValue( false ) >]
@@ -414,7 +414,7 @@ and [<Struct; IsByRefLike>] WidgetCollectionChangesEnumerator
414414 (
415415 mode : EnumerationMode < WidgetCollectionAttribute >,
416416 canReuseView : Widget -> Widget -> bool ,
417- compareScalars : struct ( ScalarAttributeKey * obj * obj ) -> ScalarAttributeComparison
417+ compareScalars : ScalarAttributeKey -> obj -> obj -> ScalarAttributeComparison
418418 ) =
419419
420420 [<DefaultValue( false ) >]
@@ -515,7 +515,7 @@ and [<Struct; IsByRefLike>] WidgetCollectionItemChangesEnumerator
515515 prev : Span < Widget >,
516516 next : Span < Widget >,
517517 canReuseView : Widget -> Widget -> bool ,
518- compareScalars : struct ( ScalarAttributeKey * obj * obj ) -> ScalarAttributeComparison
518+ compareScalars : ScalarAttributeKey -> obj -> obj -> ScalarAttributeComparison
519519 ) =
520520 [<DefaultValue( false ) >]
521521 val mutable private current : WidgetCollectionItemChange
0 commit comments