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

Ambigous Implementations when using using on a constrainted interface implementation #307

Open
fabianhjr opened this issue Apr 22, 2020 · 0 comments

Comments

@fabianhjr
Copy link
Contributor

Steps to Reproduce

module Test

interface Simple a where
  op : a -> a -> a

interface Simple a => Constraint a where
  square : a -> a
  square x = x `op` x  

-- And
[NamedSimple1] Simple Bool where
  op True True = True
  op _    _    = False

-- Or
[NamedSimple2] Simple Bool where
  op False False = False
  op _     _     = True

[Constrainted1] Constraint Bool using NamedSimple1 where
[Constrainted2] Constraint Bool using NamedSimple2 where

Expected Behavior

Should typecheck and use their corresponding implementations

Observed Behavior

Test.idr:21:1--23:1:While processing right hand side of Constrainted2 at Test.idr:21:1--23:1:
Multiple solutions found in search. Possible correct results:
	NamedSimple1
	NamedSimple2
@fabianhjr fabianhjr changed the title Ambigous Implementations when using using Ambigous Implementations when using using on a constrainted interface implementation Apr 22, 2020
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