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

Can't unify an interface with its instance #330

Open
berewt opened this issue Apr 27, 2020 · 0 comments
Open

Can't unify an interface with its instance #330

berewt opened this issue Apr 27, 2020 · 0 comments

Comments

@berewt
Copy link
Contributor

berewt commented Apr 27, 2020

The compiler seems to struggle to unify interfaces with dependent types with their implementation.

Steps to Reproduce

try to compile this module:

module Test

data Dummy : (lbl : Type) -> (st : List lbl) -> Type -> Type where
  MkDummy : a -> Dummy b st a


public export
interface IxPure (f : (lbl : Type) -> (st : List lbl) -> Type -> Type)
          where
  ixPure : a -> f lbl st a

IxPure Dummy where
  ixPure = MkDummy

pure12 : Dummy String xs Integer
pure12 = ixPure $ 12

Fails with:

Expected Behavior

It should compile.

Observed Behavior

It fails with:

Test.idr:16:10--17:1:While processing right hand side of pure12 at Test.idr:16:1--17:1:
Can't find an implementation for IxPure ?f

Workarounds

Specifying explicitly the value of f in pure12 solve the issue:

pure12 : Dummy String xs Integer
pure12 = ixPure {f = Dummy} $ 12

And the problem disappears as well if we remove the st parameters.

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