Skip to content

Modernize Index module to use modern record extensions#860

Open
mwihoti wants to merge 11 commits into
IntersectMBO:mainfrom
mwihoti:feature/811-modern-record-extensions
Open

Modernize Index module to use modern record extensions#860
mwihoti wants to merge 11 commits into
IntersectMBO:mainfrom
mwihoti:feature/811-modern-record-extensions

Conversation

@mwihoti

@mwihoti mwihoti commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Description

Modernize the Index module to use modern Haskell record extensions (DuplicateRecordFields, NoFieldSelectors, OverloadedRecordDot) instead of RecordWildCards.This change replaces record wildcard patterns with explicit dot notation field access, making the code more maintainable and aligned with modern Haskell best practices.

  • Updated Index/CompactAcc.hs:

    • Add modern record extensions
    • Replace IndexCompactAcc{..} wildcards with explicit parameter binding and dot notation
    • Update all field accesses to use ica.field syntax
  • Updated Index/Compact.hs:

    • Add modern record extensions
    • Replace IndexCompact{..} wildcards with explicit parameter binding and dot notation
    • Update all field accesses to use idx.field syntax
    • Fix countClashes, hasClashes, sizeInPages to use lambda syntax
  • Updated test file test/Test/Database/LSMTree/Internal/Index/Compact.hs:

Checklist

  • Read our contribution guidelines at CONTRIBUTING.md, and make sure that this PR complies with the guidelines.
  • Test passes
  • Builds successfully
image image

@mwihoti

mwihoti commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

Hello, @jorisdral I've made a pr that modernizes the Index module by adopting modern language extensions. Ready for review. I plan to work on Internal/Merge.hs and Internal/RunAcc.h next.

@jorisdral

Copy link
Copy Markdown
Collaborator

@mwihoti I think your fork's main branch and lsm-tree's main branch are out of date, causing a lot of git conflicts and outdated information. You should sync your fork's main branch and rebase your feature/911-modern-record-extensions branch on top of your fork's main branch

@mwihoti
mwihoti force-pushed the feature/811-modern-record-extensions branch from 0cdbad5 to 2a9c035 Compare July 21, 2026 10:16
mwihoti added 10 commits July 21, 2026 13:25
  extension scope

  - Remove unnecessary parentheses around dot-access expressions (value.field)
  - Only enable DuplicateRecordFields/NoFieldSelectors in Run and RunReader
    where field names were actually refactored; other modules get
  OverloadedRecordDot only
Unsafe.hs: restore parens around function applications
 Config/Override.hs: fix corrupted override instance for MergeBatchSize
Benchmarks: update to dot syntax with renamed fields (bloomFilter, index,
    kOpsFile) and add OverloadedRecordDot pragma to both benchmark files
…dFields,NoFieldSelectors, OverloadedRecordDo) replacing RecordWildCards usage in Index/CompactAcc.hs and Index/Compact.hs
@mwihoti
mwihoti force-pushed the feature/811-modern-record-extensions branch from 2a9c035 to 1af54e9 Compare July 21, 2026 10:25
@mwihoti

mwihoti commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

Hi @jorisdral, hope you are well sorry about the conflicts, I've rebased the branch, no more conflicts. if everything is good I plan to work on Internal/Merge.hs and Internal/RunAcc.hs. Thanks

@jorisdral

Copy link
Copy Markdown
Collaborator

There are still some merge conflict artifacts, see https://github.com/IntersectMBO/lsm-tree/pull/860/files

@mwihoti

mwihoti commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

Hello, I fixed the conflicts, builds successfully

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