Singleton values should belong to Identity, that way they’d be a part of Traversable, Foldable, Functor, Monad, etc. Scala kind-of allows this, but not completely implicitly:
// Following works!
val three: Id[Int] = 3
three.map(_ + 1)
// Sadly this doesn't:
3.map(_ + 1)
Singleton values should belong to Identity, that way they’d be a part of Traversable, Foldable, Functor, Monad, etc. Scala kind-of allows this, but not completely implicitly:
from what I understand, R does just that without any macroscopic issue