gopher.monads.ReadChannelCpsMonad.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scala-gopher_3.0.0-RC2 Show documentation
Show all versions of scala-gopher_3.0.0-RC2 Show documentation
scala-gopher: asynchronous implementation of CSP ( go-like channels/selectors ) in scala
The newest version!
package gopher.monads
import gopher._
import cps._
import gopher.impl._
given ReadChannelCpsMonad[F[_]](using Gopher[F]): CpsMonad[ [A] =>> ReadChannel[F,A]] with
def pure[T](t:T): ReadChannel[F,T] =
ReadChannel.fromValues[F,T](t)
def map[A,B](fa: ReadChannel[F,A])(f: A=>B): ReadChannel[F,B] =
fa.map(f)
def flatMap[A,B](fa: ReadChannel[F,A])(f: A=>ReadChannel[F,B]): ReadChannel[F,B] =
new ChFlatMappedReadChannel[F,A,B](fa,f)
© 2015 - 2025 Weber Informatics LLC | Privacy Policy