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

move Cardinality to type level #35

Closed
matthewleon opened this issue Jan 28, 2018 · 3 comments
Closed

move Cardinality to type level #35

matthewleon opened this issue Jan 28, 2018 · 3 comments

Comments

@matthewleon
Copy link
Contributor

Once purescript/purescript#3058 is merged, perhaps BoundedEnum could get a new param, with its cardinality defined at type level, with a fundep from the type to the cardinality.

@garyb
Copy link
Member

garyb commented Jan 28, 2018

Does that give us any advantages? It also kinda clutters up the constraint, since we don't have associated types.

@matthewleon
Copy link
Contributor Author

Honestly this might be excessive zeal for safety on my part. My thinking was that it allows this Range idea that I'm working on to have a type-level natural as well, which would mean that you could get an efficient toEnum' that lacks a Maybe, if you were to use the types from modular-arithmetic. But really, that is probably getting to the point of being cumbersome. And it could be defined in a separate lib, too.

If I can't think of something better here, I could close this.

@matthewleon
Copy link
Contributor Author

I think I can accomplish what I'm looking for without 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

No branches or pull requests

2 participants