Skip to content

Add lenses for EncodeOptions and FormatOptions - #235

Open
neilmayhew wants to merge 2 commits into
snoyberg:masterfrom
neilmayhew:options-lenses
Open

neilmayhew wants to merge 2 commits into
snoyberg:masterfrom
neilmayhew:options-lenses

Conversation

@neilmayhew

@neilmayhew neilmayhew commented Sep 1, 2026 •

Copy link
Copy Markdown

It's bugged me for a long time that the only way to request no wrapping is quite clunky. The best I could come up with was:

Nothing `setWidth` defaultFormatOptions `setFormat` defaultEncodeOptions

The lenses make it possible to do it much more clearly:

defaultEncodeOptions & formatL . widthL .~ Nothing

However, we don't want a lens or microlens dependency in yaml so this PR encodes van Laarhoven lenses explicitly. They can then be used with whatever lens/optics library the user prefers.

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.

1 participant