scalaz contains a way to simulate something similar to a Haskell
newtype, where we can take an existing type, and create a new type
from it, and allow us to create new typeclass instances for our
newly created type to get different behaviors. The same thing could
be done with scala 2.10's Value Classes:
http://docs.scala-lang.org/overviews/core/value-classes.html however
one has to be very careful when using value classes, becuase there
are a lot of instances in which using a value class will incur a
runtime boxing/unboxing of your value, which incurs a runtime
cost. The scalaz tagged types will never cause boxing of a value.
scalaz contains a way to simulate something similar to a Haskell newtype, where we can take an existing type, and create a new type from it, and allow us to create new typeclass instances for our newly created type to get different behaviors. The same thing could be done with scala 2.10's Value Classes: http://docs.scala-lang.org/overviews/core/value-classes.html however one has to be very careful when using value classes, becuase there are a lot of instances in which using a value class will incur a runtime boxing/unboxing of your value, which incurs a runtime cost. The scalaz tagged types will never cause boxing of a value.