Created
May 7, 2017 11:52
-
-
Save rootmos/0f0e8226f1d2adc479cb9fce599f0281 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
import scala.annotation.tailrec | |
object Nothingness extends App { | |
@tailrec | |
def diverge[A](): A = diverge[A]() | |
trait A | |
implicit def `A and ¬A is a contradiction`(implicit a: A, notA: A => Nothing): Nothing = notA(a) | |
implicit val notA: A => Nothing = { _ => diverge() } | |
implicit val proofOfA = new A {} | |
implicit def `Embrace the nothingness`[P, Q](implicit p: P): Q = implicitly[Nothing] | |
trait B | |
trait C | |
val b: B = new C {} | |
val i: Int = b | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment