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

Work out newtype and fundep scheme to avoid instance overlaps #17

Open
solomon-b opened this issue Feb 6, 2023 · 0 comments
Open

Work out newtype and fundep scheme to avoid instance overlaps #17

solomon-b opened this issue Feb 6, 2023 · 0 comments

Comments

@solomon-b
Copy link
Owner

For example:

deriving via FromApplicative (Proxy :: Type -> Type) instance Semigroupal (->) (,) (,) (Proxy :: Type -> Type)
deriving via FromDivisible (Proxy :: Type -> Type) instance Semigroupal (->) (,) (,) (Proxy :: Type -> Type)

deriving via FromAlternative (Proxy :: Type -> Type) instance Semigroupal (->) Either (,) (Proxy :: Type -> Type)
deriving via FromDecidable (Proxy :: Type -> Type) instance Semigroupal (->) Either (,) (Proxy :: Type -> Type)

The instances are indistinguishable because we don't mention the input category in Semigroupal. Unfortunately the reason for this is that the input category doesn't actually occur in the operation of Semigroupal leading to ambiguity which would require tedious type application from our users to resolve. To have are cake and eat it too, we would need to add this input category type parameter to Semigroupal and come up with a system of fundeps so that it would fixed without the use of type applications.

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