Created
November 22, 2019 17:17
-
-
Save vigoo/e24a49ac013c30baf92e318dca2d1cac to your computer and use it in GitHub Desktop.
prox 3/11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait ContextOf[PN] { | |
type Context[_] | |
} | |
object ContextOf { | |
type Aux[PN, F[_]] = ContextOf[PN] { | |
type Context[_] = F[_] | |
} | |
def apply[PN <: ProcessNode[_, _, _, _, _], F[_]](implicit contextOf: ContextOf.Aux[PN, F]): Aux[PN, F] = contextOf | |
implicit def contextOfProcess[F[_], Out, Err, OutResult, ErrResult, IRS <: RedirectionState, ORS <: RedirectionState, ERS <: RedirectionState]: | |
Aux[Process[F, Out, Err, OutResult, ErrResult, IRS, ORS, ERS], F] = | |
new ContextOf[Process[F, Out, Err, OutResult, ErrResult, IRS, ORS, ERS]] { | |
override type Context[_] = F[_] | |
} | |
implicit def contextOfPipedProcess[ | |
F[_], | |
Out, Err, | |
PN1 <: ProcessNode[_, _, _, _, _], | |
PN2 <: ProcessNode[_, _, _, _, _], | |
IRS <: RedirectionState, ORS <: RedirectionState, ERS <: RedirectionState]: | |
Aux[PipedProcess[F, Out, Err, Byte, PN1, PN2, IRS, ORS, ERS], F] = | |
new ContextOf[PipedProcess[F, Out, Err, Byte, PN1, PN2, IRS, ORS, ERS]] { | |
override type Context[_] = F[_] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment