Instance of typeclass for types of kind * where a type of kind * -> * is expected
<p>I'm trying to create an instance of the scalaz's <a href="https://oss.sonatype.org/service/local/repositories/releases/archive/org/scalaz/scalaz_2.11/7.1.4/scalaz_2.11-7.1.4-javadoc.jar/!/index.html#scalaz.IsEmpty" rel="nofollow"><code>IsEmpty</code></a> typeclass for <code>String</code>. This is what I've got so far:</p>

<pre><code>implicit val stringIsEmpty = new IsEmpty[({ type t[+A] = String })#t] {
  def isEmpty[A](fa: String) = ???
  def empty[A] = ???
  def plus[A](a: String, b: =&gt; String) = ???
}

def f[F[_]: IsEmpty, A](fa: F[A]): F[A] = fa
</code></pre>

<p>Now, <code>String</code> is of kind <code>*</code> whereas <code>IsEmpty[F]</code> expects <code>F</code> to be of kind <code>* -&gt; *</code>, hence the type lambda <code>f[+A] = String</code>.</p>

<p>This works, but only if the string is typed as <code>t</code>, that is:</p>

<pre><code>// doesn't compile
f("hello")

// compiles if I extract `t` into a type alias and annotate the string with it
type t[+A] = String
implicit val stringIsEmpty = new IsEmpty[t] { /** **/ }

f("hello": t[Nothing])
</code></pre>

<p>Is there any way to implement <code>IsEmpty</code> in such a way that I can then apply <code>f</code> to a string as normal?</p>