Skip to content

Instantly share code, notes, and snippets.

@fishmacs
Forked from missingfaktor/gist:1153355
Last active August 29, 2015 14:21
Show Gist options
  • Save fishmacs/c547035e634ff0b1df30 to your computer and use it in GitHub Desktop.
Save fishmacs/c547035e634ff0b1df30 to your computer and use it in GitHub Desktop.
scala> import scalaz._
import scalaz._
scala> import Scalaz._
import Scalaz._
scala> ∅[Boolean]
res0: Boolean = false
scala> ∅[Int]
res1: Int = 0
scala> ∅[String]
res2: String = ""
scala> ∅[Seq[Int]]
res3: Seq[Int] = Vector()
scala> :paste
// Entering paste mode (ctrl-D to finish)
case class Complex(real: Double, imag: Double)
object Complex {
implicit val Zero = zero(Complex(0.0, 0.0))
}
// Exiting paste mode, now interpreting.
defined class Complex
defined module Complex
scala> ∅[Complex]
res4: Complex = Complex(0.0,0.0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment