Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor EnumerationMode #1091

Merged
merged 1 commit into from
Dec 15, 2024
Merged

Refactor EnumerationMode #1091

merged 1 commit into from
Dec 15, 2024

Conversation

kerams
Copy link
Contributor

@kerams kerams commented Nov 24, 2024

struct adds extra overhead. because case elements are not stored in the tupled form but as separate fields in the struct.

@kerams
Copy link
Contributor Author

kerams commented Nov 24, 2024

We could go further with

[<Struct; IsByRefLike; RequireQualifiedAccess; NoComparison; NoEquality>]
type EnumerationMode<'a> =
    | AllAdded of prev: 'a[] 
    | AllRemoved of prev: 'a[] 
    | Empty
    | ActualDiff of prev: 'a[] * next: 'a[]

This would get rid of the bool in the DU struct at the cost of slightly confusing case field names. (Although struct field merging might require F# 9 and SDK 9)

@kerams
Copy link
Contributor Author

kerams commented Dec 14, 2024

ping

@edgarfgp
Copy link
Member

This would get rid of the bool in the DU struct at the cost of slightly confusing case field names. (Although struct field merging might require F# 9 and SDK 9)

We can not update the target to NET 9 because Fabulouls.Avalonia still targets NET 8.

Copy link
Member

@edgarfgp edgarfgp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Kerams

@edgarfgp edgarfgp merged commit 34c6b1b into fabulous-dev:main Dec 15, 2024
1 check failed
@kerams kerams deleted the fff branch December 15, 2024 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants