Skip to content

Instantly share code, notes, and snippets.

@sellout
Created September 29, 2016 15:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sellout/d6bec85658c0ba36fe74ede926d4877d to your computer and use it in GitHub Desktop.
Save sellout/d6bec85658c0ba36fe74ede926d4877d to your computer and use it in GitHub Desktop.
+ object ::\:: {
+ def apply[F[_]] = new Aux[F]
+
+ final class Aux[F[_]] {
+ def apply[T[_[_]], G[_]]
+ (i: Injectable.Aux[G, QScriptTotal[T, ?]])
+ (implicit F: F :<: QScriptTotal[T, ?])
+ : Injectable.Aux[Coproduct[F, G, ?], QScriptTotal[T, ?]] =
+ Injectable.coproduct(Injectable.inject[F, QScriptTotal[T, ?]], i)
+ }
+ }
+
+ def ::/::[T[_[_]], F[_], G[_]]
+ (implicit F: F :<: QScriptTotal[T, ?], G: G :<: QScriptTotal[T, ?])
+ : Injectable.Aux[Coproduct[F, G, ?], QScriptTotal[T, ?]] =
+ Injectable.coproduct(
+ Injectable.inject[F, QScriptTotal[T, ?]],
+ Injectable.inject[G, QScriptTotal[T, ?]])
implicit val QS: Injectable.Aux[QS, QScriptTotal[Fix, ?]] =
- Injectable.coproduct(Injectable.inject[QScriptCore[Fix, ?], QScriptTotal[Fix, ?]],
- Injectable.coproduct(Injectable.inject[ThetaJoin[Fix, ?], QScriptTotal[Fix, ?]],
- Injectable.coproduct(Injectable.inject[Const[Read, ?], QScriptTotal[Fix, ?]],
- Injectable.inject[Const[DeadEnd, ?], QScriptTotal[Fix, ?]])))
+ ::\::[QScriptCore[Fix, ?]](
+ ::\::[ThetaJoin[Fix, ?]](
+ ::/::[Fix, Const[Read, ?], Const[DeadEnd, ?]]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment