I was able to duplicate what you described with this Label definition:
import GHC.TypeLits (Symbol) data Label (a :: Symbol)
And adding:
type instance Typ (Label x) String = ()
Then provides type func2
Edit
Sorry, I misunderstood the concern. I understand that constraint feasibility testing will be delayed until func2 is used, as an instance can be added later.
For example, adding:
func3 = func2 (undefined :: Label "la") ""
Makes it crash during compilation.
The way I understand this is that func2 says that if you give me Label "la" and String , and the instance of Typ (Label "la") String is in scope at that time, I will give you a String . But func2 doesn't have to have an instance in sight to know what it would do with one if it were.
source share