-
-
Save stephen-lazaro/c6deeaa58dae72e9ea6fa1391a215a92 to your computer and use it in GitHub Desktop.
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
// Notice we're just extending our prior notion. | |
trait Alternative[F[_]] { | |
// Kind of like true, or 1 | |
def pure[A](x: A): F[A] | |
// Kind of like boolean AND, or multiplication | |
def product[A, B](fa: F[A], fb: F[B]): F[(A, B)] | |
// Kind of like false, or 0 | |
def empty[A]: F[A] | |
// Kind of like boolean XOR, or addition | |
// Named this way for Reasons™ | |
def combineK[A](x: F[A], y: F[A]): F[A] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment