Comments on: A Post About Nothing https://oldfashionedsoftware.com/2008/08/20/a-post-about-nothing/ Thu, 20 Dec 2018 12:55:02 +0000 hourly 1 https://wordpress.org/?v=6.0.1 By: Matt https://oldfashionedsoftware.com/2008/08/20/a-post-about-nothing/#comment-2375 Thu, 20 Dec 2018 12:55:02 +0000 http://oldfashionedsoftware.com/?p=36#comment-2375 Thanks for the clear comparisons. I understand them all as separate now, with the exception of None and Unit. If a method that doesn’t return a value of any sort returns Unit (a unary type, with a single instantiation), couldn’t Option[T] be rather defined as either T or Unit. Is there a reason for the None object? It seems to me None.type has a single instantiation None and Unit has a single instantiation (). These seem parallel to me. Perhaps I’ve missed something.

I’ve tried searching for distinctions without success. Just interested if someone knows

]]>
By: ahmad https://oldfashionedsoftware.com/2008/08/20/a-post-about-nothing/#comment-2144 Fri, 26 Oct 2018 09:54:26 +0000 http://oldfashionedsoftware.com/?p=36#comment-2144 “If any of these is a little difficult to get, it’s Nothing. Nothing is another trait.”

But it’s not a trait it is an abstract final class!

]]>
By: Prashant https://oldfashionedsoftware.com/2008/08/20/a-post-about-nothing/#comment-1716 Tue, 05 Jun 2018 14:39:50 +0000 http://oldfashionedsoftware.com/?p=36#comment-1716 Hi Matt, Very good explanation! Could you please elaborate on Nothing.

val emptyIntList: List[Int] = List[Nothing]()

Above thing can be achieved using below approach:

val emptyIntList: List[Int] = List()

Thanks in advance

]]>