This file contains 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
import java.util.concurrent.{ConcurrentHashMap, ConcurrentMap} | |
import java.util.function.BiFunction | |
case class Ticket(id: String) | |
case class Client(id: String) | |
case class TicketAndClient(ticket: Ticket, client: Option[Client]) | |
trait TicketSystem { | |
/** |
This file contains 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
package at.bhuemer.fpis.chapter11 | |
import scala.concurrent.{Await, ExecutionContext, Future} | |
/** | |
* | |
*/ | |
trait Monad[F[_]] { self => | |
// The primitives that any monad implementation must provide |
This file contains 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
package at.bhuemer.fpis.chapter07 | |
import java.util.concurrent._ | |
import java.util.concurrent.atomic.AtomicReference | |
/** | |
* Rather than defining Par simply as a function, we'll introduce a special purpose trait .. | |
*/ | |
sealed trait Par[A] { | |
def apply(ex: ExecutorService): Future[A] |
This file contains 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
package at.bhuemer.blog.monad | |
import scalaz.syntax.plus._ | |
import scalaz.syntax.monad._ | |
import scalaz.{Monad, Functor, MonadPlus} | |
import scala.collection.immutable.{List, Nil} | |
object PackageManager { |