scalalandio / catnip

Static annotations for Kittens for people who don't like to write semiautomatic derivations into companion objects themselves.
https://scalalandio.github.io/catnip/
Apache License 2.0
42 stars 4 forks source link

Add support for `cats.kernel.Hash` #9

Open MateuszKubuszok opened 6 years ago

MateuszKubuszok commented 6 years ago

So far I was unable to make

import cats.instances._

final case class Test[A](a: A)

cats.derived.semi.emptyK[Test]

compile. Since Pure requires EmptyK, it stops both derivations from happening in @Semi.

I guess importing cats.derived.auto._ would help but I hope for some better solution.

MateuszKubuszok commented 6 years ago

@oleg-py, you were trying to achieve that, right?

oleg-py commented 6 years ago

Yep. I've faced the same problem :)

MateuszKubuszok commented 6 years ago

Maybe it's a big in Kittens? I mean, they have tests only for auto._ but none for semi.

MateuszKubuszok commented 5 years ago

Because I want to release https://github.com/scalalandio/catnip/pull/13 ASAP I had to add Hash to the list. Hopefully, someone could help me figure that out.

MateuszKubuszok commented 5 years ago

After some playing with REPL I came to conslusion that EmptyK probably doesn't fit @Semi use cases as it produces EmptyK[FG] for some F[_]: Pure, G[_]: EmptyK, type FG[A] = F[G[A]].

It also appears that alleycats.Pure is worksing with kittens 2.0.0.

That only lives cats.Hash, which I am unable to make work in my REPL, no matter auto or semi so it's probably something about my configuration, though I cannot officially claim that it works.