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

Promote 'ChangeChain' from the term-level to type-level on 'AddressPool' #177

Merged
merged 1 commit into from
Apr 24, 2019

Conversation

KtorZ
Copy link
Member

@KtorZ KtorZ commented Apr 24, 2019

Issue Number

#95

Overview

  • I have promoted the ChangeChain to the type-level in AddressPool such that we end up with two distinguished types for AddressPool 'ExternalChain and AddressPool 'InternalChain.

Comments

The main interest here is to makes sure we don't end up using the internal chain where the external chain should be used, and vice-versa (for instance, the nextChangeIndex function now requires, unambiguously: AddressPool 'InternalChain.

Open to discussion, maybe this brings in too much complexity / type-level magic.

@KtorZ KtorZ requested a review from Anviking April 24, 2019 13:47
@KtorZ KtorZ self-assigned this Apr 24, 2019
Copy link
Collaborator

@Anviking Anviking left a comment

Choose a reason for hiding this comment

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

The Typeable stuff in the tests looks a bit awkward, but I think it makes sense still 👍

@KtorZ
Copy link
Member Author

KtorZ commented Apr 24, 2019

@johannes Yeah, this is a bit counter-intuitive because, we have actually different types here and quickcheck is about generating random values; hence the need for writing properties for both types. Perhaps with can work around this with an opaque type holding an existential 🤔

@johannes
Copy link

I doubt you wanted to highlight me ;-)

@KtorZ
Copy link
Member Author

KtorZ commented Apr 24, 2019

@johannes Whoops, indeed 😂 ...

@KtorZ KtorZ merged commit 04e6bff into master Apr 24, 2019
@KtorZ KtorZ deleted the KtorZ/95/addresspool-changechain-type-discrimination branch April 24, 2019 14:16
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.

None yet

3 participants