typelevel / skunk

A data access library for Scala + Postgres.
https://typelevel.org/skunk/
MIT License
1.56k stars 157 forks source link

Add mention of kind-projector in doc #416

Open gabrieljones opened 3 years ago

gabrieljones commented 3 years ago

full example from https://github.com/tpolecat/skunk/blob/v0.0.24/modules/docs/src/main/paradox/tutorial/Command.md gives following compile errors

skunk-world/src/main/scala/CommandExample.scala:42:34
not found: type *
  def fromSession[F[_] : Bracket[*[_], Throwable]](s: Session[F]): PetService[F] =

skunk-world/src/main/scala/CommandExample.scala:42:24
cats.effect.Bracket[<error>,Throwable] does not take type parameters
  def fromSession[F[_] : Bracket[*[_], Throwable]](s: Session[F]): PetService[F] =

skunk-world/src/main/scala/CommandExample.scala:44:63
could not find implicit value for parameter F: cats.effect.BracketThrow[[x]F[x]] (Could not find an instance of Monad for [x]F[x])
      def insert(pet: Pet): F[Unit] = s.prepare(insertOne).use(_.execute(pet)).void

skunk-world/src/main/scala/CommandExample.scala:46:73
could not find implicit value for parameter F: cats.effect.BracketThrow[[x]F[x]] (Could not find an instance of Monad for [x]F[x])
      def insert(ps: List[Pet]): F[Unit] = s.prepare(insertMany(ps)).use(_.execute(ps)).void

skunk-world/src/main/scala/CommandExample.scala:79:16
value insert is not a member of Nothing
        _ <- s.insert(Pet("Bob", 12))

skunk-world/src/main/scala/CommandExample.scala:80:16
value insert is not a member of Nothing
        _ <- s.insert(beagles)

skunk-world/src/main/scala/CommandExample.scala:81:17
value selectAll is not a member of Nothing
        ps <- s.selectAll
tpolecat commented 3 years ago

You need the kind-projector compiler plugin. We should add that to the doc.

gabrieljones commented 3 years ago

Added kind-projector and it all worked swimmingly. https://gist.github.com/koterpillar/edea748d363cb73a795c8ed3970e1b9f#gistcomment-3680511