Skip to content

Add TableConfig fields to the haddocks - #885

Open
mwihoti wants to merge 1 commit into
IntersectMBO:mainfrom
mwihoti:fix/795-tableconfig-haddock-fields
Open

mwihoti wants to merge 1 commit into
IntersectMBO:mainfrom
mwihoti:fix/795-tableconfig-haddock-fields

Conversation

@mwihoti

@mwihoti mwihoti commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Description

Resolves #795.

The TableConfig fields were missing from the docs because Haddock only shows record fields when the constructor is exported, and we keep the constructor hidden on purpose so that adding a field later isn't a breaking change which is why the (..) approach in #816 didn't fly.

So instead of listing the fields inside the TableConfig export, this exports the selectors as plain functions from Database.LSMTree and Database.LSMTree.Simple. The constructor is still hidden, but each field now shows up in haddocks with its type. The field documentation stays on TableConfig, as before.

Before(Hackage, 1.1.1.0): https://hackage-content.haskell.org/package/lsm-tree-1.1.1.0/docs/Database-LSMTree.html#t:TableConfig — the type doc only, no fields.

I also checked blockio and bloomfilter for the same export pattern, as asked in the issue — TableConfig was the only one.

Checklist

  • Read our contribution guidelines at CONTRIBUTING.md, and make sure that this PR complies with the guidelines.
  • Cabal build and test passed successfully

@mwihoti
mwihoti force-pushed the fix/795-tableconfig-haddock-fields branch from 4b6fe54 to 668bd92 Compare September 16, 2026 06:26

@jorisdral jorisdral left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Changes look good to me! I have a few small requests and then we can merge this

-- batches improves overall performance but some updates will take a lot
-- longer than others. The default is to use a large batch size.
, confMergeBatchSize :: !MergeBatchSize
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think I'd prefer the previous version, where the documentation was on TableConfig. So let's rewind that

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll revert to the previous version

Comment thread lsm-tree/CHANGELOG.md Outdated
Comment on lines +41 to +44
* The record fields of `TableConfig` are now rendered in the haddocks, with
their types and documentation. See [issue
#795](https://github.com/IntersectMBO/lsm-tree/issues/795) and [PR
#885](https://github.com/IntersectMBO/lsm-tree/pull/885).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think this is a breaking change, since we're exporting the fields no longer as part of TableConfig, but as separate entities in the export list

Comment on lines 129 to +128
defaultTableConfig,
confMergePolicy,
confMergeSchedule,
confSizeRatio,
confWriteBufferAlloc,
confBloomFilterAlloc,
confFencePointerIndex,
confDiskCachePolicy,
confMergeBatchSize,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Did you deliberately sort them a different way? Let's keep the order as it was

Suggested change
defaultTableConfig,
confMergePolicy,
confMergeSchedule,
confSizeRatio,
confWriteBufferAlloc,
confBloomFilterAlloc,
confFencePointerIndex,
confDiskCachePolicy,
confMergeBatchSize,
confMergePolicy,
confSizeRatio,
confWriteBufferAlloc,
confBloomFilterAlloc,
confFencePointerIndex,
confDiskCachePolicy,
confMergeSchedule,
confMergeBatchSize,
defaultTableConfig,

Comment on lines +100 to +106
confMergePolicy,
confMergeSchedule,
confSizeRatio,
confWriteBufferAlloc,
confBloomFilterAlloc,
confFencePointerIndex,
confDiskCachePolicy,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Did you deliberately sort them a different way? Let's keep the order as it was

Suggested change
confMergePolicy,
confMergeSchedule,
confSizeRatio,
confWriteBufferAlloc,
confBloomFilterAlloc,
confFencePointerIndex,
confDiskCachePolicy,
confMergePolicy,
confSizeRatio,
confWriteBufferAlloc,
confBloomFilterAlloc,
confFencePointerIndex,
confDiskCachePolicy,
confMergeSchedule

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I have maintained the way the order was

The fields were missing from the docs because Haddock only shows record fields when the constructor is exported, and we keep TableConfig's constructor hidden on purpose so that adding a field later isn't a breaking change (that's why the (..) approach in IntersectMBO#816 didn't fly).

So instead of listing the fields inside the TableConfig export, I export the selectors as plain functions from Database.LSMTree and Database.LSMTree.Simple. The constructor is still hidden, but now each field
shows up with its type. The field docs stay on TableConfig.

Resolves IntersectMBO#795.
@mwihoti
mwihoti force-pushed the fix/795-tableconfig-haddock-fields branch from e6c390d to c891c5f Compare September 29, 2026 17:48
@mwihoti
mwihoti requested a review from jorisdral September 30, 2026 06:00

This branch has not been deployed

No deployments
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.

[BUG] The haddock documentation on lsm-tree's Hackage page for TableConfig is missing record fields

2 participants