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

Get rid of possible harmful orphan instances. #2

Open
bolt12 opened this issue Jan 28, 2020 · 2 comments
Open

Get rid of possible harmful orphan instances. #2

bolt12 opened this issue Jan 28, 2020 · 2 comments

Comments

@bolt12
Copy link
Owner

bolt12 commented Jan 28, 2020

Right now I have Enum, Bounded orphan instance for Pairs (,) and Either types. And I'm looking to add an Enum instance for the List [] type.

The reason for this is that this instances are needed in order to lift functions to relations and to define a couple of relational operators.

Since this orphan instances can be harmful because they might not be what one would exactly desire maybe it would be a better alternative to have newtype wrappers around them like:

newtype (><) a b = P (a, b)
newtype (-|-) a b = E (Either a b)
newtype Powerset a = PS [a] 
@bolt12
Copy link
Owner Author

bolt12 commented Jan 28, 2020

This newtype wrappers should probably be used in the inductive matrix data type!

@bolt12
Copy link
Owner Author

bolt12 commented Jan 31, 2020

This would have impact on usability as it would not be as straightforward to lift a function to matrix/Relation. coerce could be of use like when using Natural.

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

1 participant