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

Extract 'dsumEncoder' from chainEncoder #1000

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

alexfmpe
Copy link
Contributor

@alexfmpe alexfmpe commented Nov 12, 2022

I wanted to call it dependentEncoder since it exhibits a bit of context dependent parsing, but then there's the dependent sum aspect and the name would get confusing. While a dependent sum encoder must be ctx dependent, the converse is not true. We can get a simpler

  => Encoder check parse a a'
  -> (a -> Encoder Identity parse b b')
  -> Encoder check parse (a,b) (a', b')

by wrapping/unwraping via Const. I'm tempted to add such a util for convenience but am not coming up with a good name. Maybe contextDependentEncoder on account of it being the simpler such encoder?

I have:

  • Based work on latest develop branch
  • Followed the contribution guide
  • Looked for lint in my changes with hlint . (lint found code you did not write can be left alone)
  • Run the test suite: $(nix-build -A selftest --no-out-link)
  • Updated the changelog
  • (Optional) Run CI tests locally: nix-build release.nix -A build.x86_64-linux --no-out-link (or x86_64-darwin on macOS)

Copy link
Member

@Ericson2314 Ericson2314 left a comment

Choose a reason for hiding this comment

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

Looks good to me!

Copy link
Member

@ryantrinkle ryantrinkle left a comment

Choose a reason for hiding this comment

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

This looks great; thanks!

@alexfmpe
Copy link
Contributor Author

Should I bundle a contextDependentEncoder with this?

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.

3 participants