re: Anatomy of an algebra VIEW POST


Given that the list of possible states for Either[Boolean, Boolean]] is:


How is possible that the list for Either[Boolean, Either[Boolean, Boolean]]] has 6 elements?



Well the 4 values you listed, wrapped in a Right, are the Right part of the Either[Boolean, Either[Boolean, Boolean]]]:


Then you have the Left part of the Either[Boolean, Either[Boolean, Boolean]]] which are the following values:


Which makes 6 values, is that ok for you ?


Yeah, it was simple, I got confused by reasoning like in the tuples case so i was expecting something like (Left(true), Right(Left(true)) and so on...
Sorry for the stupid question, feel free to cancel the previous comment ;)

No, it was a good question, maybe I should have listed all the values to make my point. Indeed if we had been working with (Either[Boolean], Either[Either[Boolean]]) we would have had 8 values !

Thanks for you question.

code of conduct - report abuse