-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend cats-autowire to handle any effect type #189
Comments
The next step may be to verify if it is possible to add support for other return types like |
Supporting |
See #190 for zio support |
ok, makes sense. It would be also good to create a pure autowire implementation. #191 |
|
// case class[F[_], T](model: F[T])
|
|
// sealed trait Injection
// case class FunctionInjection(val func: Any => Injection, val input: Injection]) extends Injection
// case class ModelInjection(val value: Any) extends Injection
// sealed trait Injection
// case class FunctionInjection(val func: Any => Injection, val input: Injection) extends Injection
// case class EffectInjection(val effectValue: F[Injection]) extends Injection
// case class ModelInjection(val value: Any) extends Injection
|
|
// val a: Injection = implement ZManaged[X, X, A]
// val b: Injection = implement ZManaged[X, X, B]
// val c: Injection = FunctionInjection(func = need => genInjectionC, input = List(a, b))
|
|
Hm, interesting idea - so |
|
// case class EffectInjection(val effectValue: F[Injection], val tag: InjectionTag) extends Injection
|
// trait EffectValue[A]
// case class RigthEffectValue[F[_], A](val effectValue: F[A]) extends EffectValue[A]
// case class EitherEffectValue[F[_, _], E, A](vall effectValue: F[E, A]) extends EffectValue[A]
// and so on
// case class EffectInjection(val effectValue: EffectValue[Injection], val tag: InjectionTag) extends Injection |
|
// case class FunctionInjection(val func: List[Injection] => Injection, val input: List[Injection]) extends Injection
// case class FunctionInjection(val func: List[Any] => Injection, val input: List[Injection]) extends Injection
|
// case class FunctionInjection(val func: List[Any] => Injection, val input: List[Injection]) extends Injection
// case class FunctionInjection(val func: Any => Injection, val input: Injection) extends Injection
|
@adamw Wrong, I think all is wrong. In fact, injection have two parts. 1 is resources, and our app is just dept on So if we use |
I use the It seems that just the @mbore It seems that this can answer the question in Gitter😊 |
Currently autowire works only for
IO
. It would be great if it would:(a) work for any
F[_]
(b) verify (if at all possible?) that all passed effects/factories/resources use the same effect type - or rather, that they can be parametrised with the same effect type
The text was updated successfully, but these errors were encountered: