Skip to content
This repository has been archived by the owner on Mar 16, 2020. It is now read-only.

Support Services defined with an HKT parameter in @accessible macro #53

Open
neko-kai opened this issue Nov 1, 2019 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@neko-kai
Copy link
Member

neko-kai commented Nov 1, 2019

The implementor should allow the generation of @accessible traits/objects to work for the following example:

@accessible
trait Example[F[_, _]] {
  val example: Example.Service[F]
}

object Example {
  trait Service[F[_, _]] {
    def foo()                 : F[Nothing, Unit]
    def bar(v1: Int, v2: Int) : F[Nothing, Int]
    def baz(v1: Int)(v2: Int) : F[Nothing, String]
  }

  // should generate
  object example extends Service[ZIO[Example[IO], *, *]] {
    def foo()                 = ZIO.accessM(_.example.foo)
    def bar(v1: Int, v2: Int) = ZIO.accessM(_.example.bar(v1, v2))
    def baz(v1: Int)(v2: Int) = ZIO.accessM(_.example.baz(v1)(v2))
  }
}
@ioleo ioleo added the enhancement New feature or request label Nov 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants